Solution

In[29]:=

(*1*)f[x_] = Cos[10Sin[x]] Plot[f[x], {x, 0, 2Pi}]

Out[29]=

Cos[10 Sin[x]]

[Graphics:../HTMLFiles/ex02_solutions_94.gif]

Out[30]=

⁃Graphics⁃

In[31]:=

(*2*)a[x_, y_] = (x + y)/2

Out[31]=

(x + y)/2

In[32]:=

(*3*)f[x_] = x * x ; g[x_] = Exp[-x] ; h[x_] = g[f[x]] Plot[h[x], {x, -2, 2}]

Out[34]=

^(-x^2)

[Graphics:../HTMLFiles/ex02_solutions_100.gif]

Out[35]=

⁃Graphics⁃

In[36]:=

(*4*)f[x_, y_] = Exp[-(x * x + y * y)] Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}, PlotRange {0, 1}]

Out[36]=

^(-x^2 - y^2)

[Graphics:../HTMLFiles/ex02_solutions_104.gif]

Out[37]=

⁃SurfaceGraphics⁃

The option PlotRange determines the range for the z-axis, or y-axis in two-dimensional plots. In the next excercise, the option Hue is used to set the color of the plot. See its help file and try different arguments.

In[38]:=

(*5*)a = 1 ; f1[x_] = Exp[a x] ; f2[x_] := Exp[a x] Plot[{f1 ... #62371;a = 0.5 ; Plot[{f1[x], f2[x]}, {x, 0, 2}, PlotStyle {Hue[0.6], Hue[0.1]}]

[Graphics:../HTMLFiles/ex02_solutions_107.gif]

Out[41]=

⁃Graphics⁃

[Graphics:../HTMLFiles/ex02_solutions_109.gif]

Out[43]=

⁃Graphics⁃


Created by Mathematica  (April 10, 2007) Valid XHTML 1.1!