## An Introduction to Mathematica for Calculus Students

- Arvind Borde

Mathematicais a powerful symbolic mathematics program that allows you to visualize mathematical expressions and to carry out calculations. As you learn about it, you'll find this online reference guide to Mathematica useful.Below you will find examples of what you can do with Mathematica. Many are based on a calculus class taught by Eric Hirschmann and myself at Southampton College over the period 1998--1999. Here are important things to keep in mind:

- Multiline input is accepted by the program. The Enter key does not make Mathematica act on input. You need to press Shift-Enter when you want something done.
- Mathematica is sensitive to case, and it requires that standard functions be entered with their first letter capitalized. Cos[x] and cos[x] are different expressions, and Mathematica will automatically recognize only the former.
- Arguments to functions must be entered in square brackets, and these delimiters cannot be used in any other context. Neither Sin(x) nor 4*[2+2] is accepted. You must use Sin[x] for the former 4*(2+2) for the latter.
Keeping in mind that you press Shift-Enter after input when you want Mathematica to act on it, here's how you

- Add 2 and 2:
2+2- Multiply 25 and 37.5:
25*37.5or25 37.5- Find the square root of 2:
Sqrt[2]You will see that the result here is not very satisfactory.

- Find the square root of 2 as a decimal:
N[Sqrt[2]]- Find the square root of 2 as a decimal with 5000 significant figures:
N[Sqrt[2], 5000]- Express π as a decimal with 175 significant figures:
N[Pi, 175]- Solve an equation:
Solve[x^2 - 98 x - 27 == 0, x]- Solve an equation numerically:
N[Solve[x^2 - 98 x - 27 == 0, x], 24]- Differentiate a function:
D[x^2 Cos[x^3] - Exp[2^x], x]- Differentiate a function many times:
D[x^2 Cos[x^3] - Exp[2^x], {x,4}]- Integrate a function:
Integrate[x^3 + x^2 + x^(-1), x]- Plot a single function:
Plot[x^2, {x, 0, 10}]- Define your own functions:
f[x_]:=x^3- Plot a function you have defined:
Plot[f[x],{x, 0, 10}]- Combine plots M and N:
Show[Out[M],Out[N]]- Plot more than one function:
Plot[{x^2,x^3},{x,0,10}]- Adjust the range of the plot in order to see more or less of the function(s):
Plot[{x^2,x^3},{x,0,10}, PlotRange->{0,300}]- Distinguish multiple functions on the same graph, using R(ed), G(reen), and B(lue) values:
Plot[{x^2,x^3},{x,0,10}, PlotStyle->{{RGBColor[1,0,0]},{RGBColor[0,1,0]}}]- Label functions on a graph:
Plot[{Sin[x], x^2, Log[x], x^3 - x, -x^2 + 1, Cos[x]}, {x, -3, 3}, PlotLegends -> "Expressions"]- Number functions on a graph (and make the lines thicker):
Plot[{Sin[x], x^2, Log[x], x^3 - x, -x^2 + 1, Cos[x]}, {x, -3, 3}, PlotLegends -> Automatic, PlotStyle -> Thick]- Plot points:
ListPlot[{{1,-1},{3,4},{5,-6}},Joined->True]- Draw 3-D plots:
Plot3D[(x^2+y^2) Exp[-(x^2+y^2)], {x,-2,2}, {y,-2,2}, PlotPoints->50]- Plot parametrized families of functions:
Plot[Evaluate[Table[E^{b*x},{b,1,4,.5}]],{x,0,3}]- Make parametric plots of curves:
ParametricPlot[{Sin[t], Sin[2t]}, {t, 0, 2 Pi}]- Make 3D parametric plots of curves:
ParametricPlot3D[{Sin[t], Sin[2t], t}, {t, 0, 2 Pi}]- Make parametric plots of surfaces:
ParametricPlot3D[{u Sin[t], u Cos[t], t}, {t, 0, 10}, {u, -1, 1}]- Make more parametric plots of surfaces:
ParametricPlot3D[{Cos[t] (3+Cos[u]), Sin[t] (3+Cos[u]), Sin[u]}, {t, 0, 2 Pi}, {u, 0, 2 Pi}]- Play with transparency of surfaces:
ParametricPlot3D[{1.16^v Cos[v] (1 + Cos[u]), -1.16^v Sin[v] (1 + Cos[u]), -2 1.16^v (1 + Sin[u])}, {u, 0, 2 Pi}, {v, -15, 6}, Mesh -> None, PlotStyle -> Opacity[0.3], PlotRange -> All, PlotPoints -> 25]- Make an animation
Animate[Plot[Sin[x + a], {x, 0, 10}], {a, 0, 5}, AnimationRunning -> False]- Make a 3D animation
Animate[ParametricPlot3D[{Cos[a t] (3 + Cos[u]), Sin[t] (3 + Cos[u]), Sin[u]}, {t, 0, 2 Pi}, {u, 0, 2 Pi}], {a, 0, 5}, AnimationRunning -> False]

http://arvind-borde.org/courses/mathematica/mathematica_for_calculus.html