Graphing more than one function in one Graph by mathematica

Question1. Graph the function f(x) = 4CosxSin2x and g(x)=-Secx  on the same axes over the domain -4Pi<x<4Pi . Restrict the range to -4<y<4 . Draw the curves in different styles so that you can distinguish the functions.

Answer:


f[x_] := 4Cos[x]*Sin[x]^2;

g[x_] := -Sec[x];
Plot[{f[x], g[x]}, {x, -4Pi, 4Pi}, 
    PlotRange -> {-4, 4}, PlotStyle -> {{RGBColor[1, 0, 0], 
      Thickness[.004]}, {RGBColor[0, 0, 1], Thickness[.002]}}];

SHIFT + ENTER



Related Posts
Previous
« Prev Post