Teaching and Authoring with Mathematica

Eugene Don, Ph.D.

Queens College, CUNY

Chapters

Getting Acqainted (70 examples and problems)

Basic Concepts (138 examples and problems)

Lists (86 examples and problems)

Two-Dimensional Graphics (60 examples and problems)

Three-Dimensional Graphics (49 examples and problems)

Equations (44 examples and problems)

Algebra and Trigonometry (58 examples and problems)

Differential Calculus (53 examples and problems)

Integral Calculus (40 examples and problems)

Multivariate Calculus (40 examples and problems)

Ordinary Differential Equations (48 examples and problems)

Linear Algebra (75 examples and problems)

Changes necessitated by Mathematica 6

Some menus and dialogue boxes have changed. Changes are mostly cosmetic.

The BasicInput palette has been renamed BasicMathInput.

Graphics output has been enhanced in version 6. Consequently  plots, particularly 3 dimensional plots, may look slightly different from those in previous versions.

In versions 4 and 5 a semicolon (;) was used merely to suppress an annoying line of output when executing graphics commands. In version 6, the semicolon suppresses graphics output completely and must therefore be deleted when using commands such as Plot, Plot3D, Show, etc.  Furthermore, since the semicolon may now be used to suppress  graphics, DisplayFunction->Identity  and  DisplayFunction->$DisplayFunction, used throughout the book  are no longer needed.

Some of the commands which had previously been supplied in packages (and had to be loaded prior to use) are now included in the kernel and may be used without invoking Needs or << .  Some of the commands are located in different packages, and some of them are available by downloading packages from the Wolfram website.

Some commands in versions 4 and 5 have been eliminated and put into “legacy” packages, included with Mathematica 6, which must be loaded prior to use.

Some commands (e.g.  ImplicitPlot) have been eliminated and their functionality has been incorporated into other commands (e.g. ContourPlot)

Animation has been significantly enhanced with the introduction of Animate.

A Limit Problem

The figure below shows a fixed circle (Subscript[C, 1]) centered at (1,0) having radius 1.  (Subscript[C, 2]) is a circle of radius r centered at the origin.   P is the positive y-intercept of (Subscript[C, 2]) and Q is the upper intersection point of the two circles. A line connects P and Q and is extended to the x-axis at point R.  Determine its limit as the radius of (Subscript[C, 2]) approaches 0.  (Stewart, Calculus)

Limit Problem (Animation)

Animate[
c1=Circle[{1,0},1];
c2=Circle[{0,0},r];
soln=Solve[{(x^2)+ (y^2)==(r^2),(((x-1))^2)+(y^2)==1},{x,y}];
qy=soln[[2,1,2]];
qx=soln[[2,2,2]];
slope=(qy-r)/qx;
xintercept=-r/slope;
pq=Line[{{0,r},{xintercept,0}}];
Show[Graphics[{Blue,c1}],Graphics[{Blue,c2}],Graphics[{Red,pq}],AspectRatio->Automatic,PlotRange->{{-2,5},{-2,2}},Axes->True,Ticks->{{-2,1,3,5},{-2,2}}],{r,2,.05,-.01}]

Limit Problem (Analytical Solution)

Define the Circles

eq1=(((x-1))^2)+(y^2)==1;
eq2 = (x^2)+(y^2)==(r^2);

Find their point(s) of intersection, Q

Solve[{eq1,eq2},{x,y}]

Compute the slope of the line connecting this point with P(0, r)

m=(((1/2)(Sqrt[4(r^2)-(r^4)])-r)/((r^2)/2));

The equation of line PQ is  y = m x + r.  Find the x-intercept of line PQ

intercept=Solve[m x+r==0,x]

Now compute the limit

Limit[intercept[[1,1,2]],r->0]

Asteroid Problem

You and your space buddy land your space ship on a spherical asteroid. Your partner walks s meters away along the surface of the asteroid holding a rod h meters tall perpendicular to the surface until you, lying on your stomach with your eye at ground level, can just barely see the tip of the rod. Determine the radius, r, of the asteroid. (Cohen and Hagin, Calculus Explorations with Mathematica)

                               (diagram not drawn to scale)

Asteroid Problem (Solution)

From the diagram it is clear that   s= r θ and cos θ=(r/(r+h)). Eliminating θ we get 
	cos((s/r)) = (r/(r+h)) 
	or
	cos((s/r)) - (r/(r+h))=0

We will solve this problem assuming h = 2 and s = 300.

h=2;
s=300;
f[r_]=Cos[(s/r)]-(r/(r+h));

We begin with a (naive) preliminary plot:

Plot[f[r],{r,0,10}]

Now we plot over larger intervals:

Plot[f[r],{r,10,100}]
Plot[f[r],{r,100,1000}]
Plot[f[r],{r,1000,10000}]

To get a more realistic interval, we argue that since s is large in comparison to h that the length AB is approximately equal to s. Invoking the theorem of Pythagoras, we can get a pretty good idea of how large r is:

Solve[r^2+s^2==(h+r)^2,r]

A new plot confirms our approximation:

Plot[f[r],{r,20000,30000}]

We can now solve the equation using this value as our initial approximation.

FindRoot[f[r],{r,22499}]

If we want a more accurate solution, we can increase  WorkingPrecision.

FindRoot[f[r],{r,22499},WorkingPrecision->20]

Fuel Tank Problem

An underground fuel tank is in the shape of an ellipsoid with semi-axes 6, 10, and 6 feet. To measure the amount of fuel in the tank, we insert a stick through the vertical axis until it touches the bottom of the tank and measure how high the fuel level is on the stick. How far from the end of the stick should a mark be placed to indicate that only 500 cubic feet of fuel is left?

Fuel Tank Problem (Solution)

a=6;
b=10;
c=6;
Clear[h]

The equation of an ellipsoid is ((x^2)/(a^2))+((y^2)/(b^2))+((z^2)/(c^2))=1. The intersection of the ellipsoid with the plane z = (Subscript[z, 0])  is an ellipse ((x^2)/(a^2))+((y^2)/(b^2))=1-(((Subscript[z, 0])^2)/(c^2)), whose area can be computed as a function of (Subscript[z, 0]). Writing this equation in the equivalent form

((x^2)/((a^2)(1-((Subscript[z, 0]^2)/(c^2)))))+((y^2)/((b^2)(1-((Subscript[z, 0]^2)/(c^2)))))=1

we see that the semi axes are  a(Sqrt[1-((Subscript[z, 0]^2)/(c^2))])   and    b(Sqrt[1-((Subscript[z, 0]^2)/(c^2))]). Since the area of an ellipse is π times the product of its semi-axes, the elliptical area is  πab(1-((Subscript[z, 0]^2)/(c^2)))

A[z_]=π a b(1-((z^2)/(c^2)));     (* We use z in place of (Subscript[z, 0]) *)

Integrating with respect to z we obtain the volume as a function of h, the height of the fuel level.

v[h_]=(∫_(-c)^(-c+h))A[z]\[DifferentialD]z;

Plot the volume function:

Plot[v[h],{h,0,2c},AxesLabel->{"h","v[h]"}]

Now we can solve for h

NSolve[v[h]==500,h]