Calculus

Graphics Commands
for
Calculus and Multivariable Calculus

By 
Dennis M. Schneider

With Assistance From
Sylvia Cook, Jeff Dunn,  Sanjay Nath,  
pete schultz, Robby Villegas, Jun Zhu, 
Ed Spencer
 
Copyright 1990-92 by Dennis M. Schneider
Work on this package partially supported by grants from
Pew Charitable Trusts
National Science Foundation
NSF-ILI Grant # USE-9050757
NSF Grant # USE-9153249
Knox College
Lilly Foundation

Notes

1.	For PlotUpperApprox, PlotLowerApprox, PlotRiemannApprox, PlotTrapApprox, set the number of subintervals with an option Subintervals->n???  For the random version of these commands, set MaxDeltax??? For PlotUpperApprox, etc set the number of points to test in searching for the maximum or minimum with SearchPoints or (MaxPoints or MinPoints respectively)???

Initialization for Calculus

Calculus Examples and Multivariable Calculus Examples illustrates the commands defined in the package Calculus.m.  That package is in the folder KnoxPackages which must be loaded in the Packages folder in the Mathematica folder.

Needs["KnoxPackages`Calculus`"]

Calculus Examples

PlotJump

?PlotJump

Here is a plot of the greatest integer function which has jumps at the integers.

PlotJump[Floor[x],{x,0,5},Jumps->{0,1,2,3,4,5}]

We can change the style of the curve and points as follows.

PlotJump[Floor[x],{x,0,5},Jumps->Range[0,5],
	PlotStyle->GrayLevel[.5]]

We can control the size of the break in the graph as follows.

Clear[f]
f[x_ /; x != 0] := Sin[x]/x
f[0] := 1/2

PlotJump[f[x],{x,-1,1},Jumps->0,AxesOrigin->{.5,.75},
	Break->.01,PlotRange->All]

Here we set the style for the curve, the points, and the size of the breaks.

Clear[f]
f[x_ /; x < 1] := Sin[2x]
f[1] := 3/4
f[x_ /; 1 < x < 2] := Log[x]
f[2] := 1

PlotJump[f[x],{x,-Pi,2},Jumps->{-Pi,1,2},
	PlotStyle->GrayLevel[.3],PointStyle->PointSize[.03],
	Break->.02]

Here we plot two functions with jump discontinuities.

Clear[f]
f[x_ /; x < -1 ] := 2 - x
f[x_ /; -1 <= x < 1] := Sin[4x]
f[1] := 4
f[x_ /; x > 1] := 4 - x

Clear[g]
g[x_ /; x < -1 ] := -1/(x + 1)
g[x_ /; -1 <= x < 1] := Cos[4x]
g[1] := 5
g[x_ /; x > 1] := x^2

PlotJump[{f[x],g[x]},{x,-2,2},Jumps->{-1,1},
	PlotStyle->{RGBColor[0,1,0],RGBColor[0,0,1]}]

Of course, PlotJump will plot functions without discontinuities.

PlotJump[{x,x^2},{x,-2,2},Jumps->{-1,1},
	PlotStyle->{RGBColor[0,1,0],RGBColor[0,0,1]}]

PlotInverse

?PlotInverse

PlotInverse[Sin[x],{x,-Pi/2,Pi/2},AspectRatio->Automatic]

When more than one function is given, each function is plotted in the same style as its inverse.

PlotInverse[{x^2,4/3 x - 4/9},{x,0,1.2},AspectRatio->Automatic]

We can surpress the line y = x by setting PlotLine->False.

PlotInverse[Sin[x],{x,-Pi/2,Pi/2},AspectRatio->Automatic,
	PlotLine->False]

Here is a plot of just the inverse function.

PlotInverse[Sin[x],{x,-Pi/2,Pi/2},AspectRatio->Automatic,
	PlotLine->False,PlotFunction->False]

Here is how to set the plot style for the inverse.

PlotInverse[Sin[x],{x,-Pi/2,Pi/2},AspectRatio->Automatic,
	InverseStyle->{{Thickness[.01],RGBColor[0,0,1]}}]

Here we set the plot style for both the function and its inverse.

PlotInverse[Sin[x],{x,-Pi/2,Pi/2},AspectRatio->Automatic,
	InverseStyle->RGBColor[0,0,1],PlotStyle->RGBColor[0,1,1],
	PlotLine->False]

Here we set styles for the inverse function, the function, and the line y = x.

PlotInverse[Sin[x],{x,-Pi/2,Pi/2},AspectRatio->Automatic,
	InverseStyle->RGBColor[0,0,1],PlotStyle->RGBColor[0,1,1],
	LineStyle->Thickness[.007]]

NewListPlot

This version of ListPlot has been upgraded to handle graphics directives specified in PlotStyle in the same way as in the Plot command.

?NewListPlot

NewListPlot[Table[(-1)^n/n,{n,50}],
	PointStyle->Table[{PointSize[.02],GrayLevel[m/75]},{m,50}],
	PlotRange->All]

Here we alternate the style used for successive points.

NewListPlot[Table[(-1)^n + 1/n,{n,50}],
	PointStyle->{GrayLevel[0],GrayLevel[.4]},
	PlotRange->All]

NewListPlot[Table[(-1)^n/n,{n,50}],
	PointStyle->{{PointSize[.017],Hue[0]},
				 {PointSize[.02],Hue[.6]}},
	PlotJoined->True,PlotRange->All]

Here we apply a style to the points and the line segments.

NewListPlot[Table[1/i,{i,10}],
	PointStyle->Hue[1],
	PlotStyle->RGBColor[0,1,0],
	PlotJoined->True]

PlotTangentLine

?PlotTangentLine

A curve and tangent line:

PlotTangentLine[Sin[x],{x,0,2Pi},TangentPoints->{Pi}];

Here is a curve and several tangent lines with styles set for the tangent lines.

PlotTangentLine[Sin[x],{x,0,2Pi},TangentPoints->{Pi/4,Pi,3Pi/2},
	AspectRatio->Automatic,
	TangentStyle->{GrayLevel[0],GrayLevel[1/3],GrayLevel[2/3]}];

Here is a curve and several tangent lines with a style set for the curve.

PlotTangentLine[Sin[x],{x,0,2Pi},TangentPoints->{Pi/4,Pi,3Pi/2},
	PlotStyle->{{Thickness[.007],Hue[2/3]}}];

Finally, here is a curve and several tangent lines with styles set for both.

PlotTangentLine[Sin[x],{x,0,2Pi},TangentPoints->{Pi/4,Pi,3Pi/2},
	TangentStyle->{GrayLevel[1/3]},
	PlotStyle->{{Thickness[.007],Hue[2/3]}}];

PlotDerivative

?PlotDerivative

Here is a plot of a function together with its first two derivatives.

PlotDerivative[x Sin[x],{x,0,2Pi},Derivatives->{1,2}]

We can set the styles as in the Plot command.

PlotDerivative[x Sin[x],{x,0,2Pi},Derivatives->{1,2},
	PlotStyle->{RGBColor[0,0,0],Thickness[.007],Thickness[.01]}]

PlotNewton

?PlotNewton

We can change the styles of the lines and points as follows.

PlotNewton[x^3 - 2 + 3x,{x,-1,5},InitialPoint->5,
	TangentStyle->RGBColor[0,0,1],PointStyle->PointSize[.03]]//PrintTime

We can also change the style of the curve.

PlotNewton[x^3 - 2 + 3x,{x,-1,5},InitialPoint->5,PointStyle->PointSize[.02],
	TangentStyle->RGBColor[0,0,1],PlotStyle->Thickness[.007]]//PrintTime

We can produce a sequence of frames suitable for animation by setting Together->False.

PlotNewton[x^3 - 2 + 3x,{x,-1,5},InitialPoint->5,
	TangentStyle->RGBColor[0,0,1],
	Together->False]//PrintTime

We can surpress the graph and ask for more iterations.

PlotNewton[x^3 - 2 + 3x,{x,-1,5},InitialPoint->5,
	Iterations->10,Graph->False]//PrintTime

Here is another example that shows that Newton's method may converge to an unexpected root.

PlotNewton[Cos[3Pi x] + Exp[-x],{x,0,1},
	InitialPoint->.6,Iterations->5]//PrintTime

PlotArea

?PlotArea

The following command will shade the area bounded by the curve and the x-axis between 0 and 2π.

PlotArea[Cos[x],{x,0,2Pi}]

Here we apply a style to the region.

PlotArea[Cos[x],{x,0,2Pi},AreaStyle->GrayLevel[.5]]

Here we apply a style to the region and the curve.

PlotArea[Cos[x],{x,0,2Pi},
	AreaStyle->GrayLevel[.5],PlotStyle->Thickness[.007]]

PlotArea allows the user to specify the domain of the plot and the range of the region to shade.

PlotArea[Sin[x],{x,0,2Pi},Between->{Pi/2,3Pi/4}]

PlotArea will plot two curves and shade the area between them.

PlotArea[{Sin[4x],Sin[x]^2},{x,0,Pi}]

We can keep the shading of the region and specify styles for the curves as follows.

PlotArea[{Sin[4x],Sin[x]^2},{x,0,Pi},
	PlotStyle->{Thickness[.007],Thickness[.01]}]

A function with a jump discontinuity.

Clear[f]
f[x_/;x<3]:=1
f[x_/;x>=3]:=-1 
PlotArea[f[x],{x,0,6}]

Here is an improper integral that converges.

PlotArea[1/Sqrt[x] Cos[2Pi x],{x,0,1},
	PlotRange->All]

You can build up more complicated regions as follows.

Plot[{x+6,-x/2,x^3},{x,-5,3},AspectRatio->Automatic]

PlotArea[{x+6,-x/2},{x,-4,3},Between->{-4,0},AspectRatio->Automatic,
	AreaStyle->RGBColor[0,1,0]]

PlotArea[{x+6,x^3},{x,-4,3},Between->{0,2},
	AspectRatio->Automatic,PlotRange->{0,10}]

Show[%,%%];

PlotIntegral

?PlotIntegral

PlotIntegral[Sin[x],{x,0,2Pi}]

Here we set the style for the antiderivative.

PlotIntegral[Sin[x],{x,0,2Pi},
	IntegralStyle->Thickness[.007]]

Here we set the style for just the shaded region.

PlotIntegral[Sin[x],{x,0,2Pi},
	AreaStyle->GrayLevel[.5]]

Here we produce frames suitable for animation by setting the option Frames to the number of frames we wish to produce.

PlotIntegral[Sin[x],{x,0,2Pi},Frames->5,
	AreaStyle->GrayLevel[.5],PlotRange->All]

Here is a function whose antiderivative is a special function.

PlotIntegral[Sin[x^2],{x,0,Pi/2}]

SurfaceOfRevolution

?SurfaceOfRevolution

Here is a plot of the surface generated when the graph of y = x3 between -1 and 1 is revolved about the x-axis.

SurfaceOfRevolution[x^3,{x,-1,1},{1,0,0}];

Here is a plot of the trace of the curve.

SurfaceOfRevolution[x^3,{x,-1,1},{1,0,0},TracePlot->True];

Here is the surface generated when the graph of y = 2 Sin[x] between 0 and 2π is revolved about the y-axis.  The plot has the x-, y-, and z-axes in their default position in Mathematica.

SurfaceOfRevolution[2Sin[x],{x,0,2Pi},{0,1,0},
	PlotPoints->{10,10}];

Setting the option Orientation->Textbook will draw the surface with the y- and z- axes interchanged.  The resulting picture corresponds to what is usually presented in Calculus textbooks.

SurfaceOfRevolution[2Sin[x],{x,0,2Pi},{0,1,0},
	PlotPoints->{10,10},Orientation->Textbook];

Here is a trace plot of the previous surface.

SurfaceOfRevolution[2Sin[x],{x,0,2Pi},{0,1,0},
	TracePlot->True,Orientation->Textbook];

Here is a plot of the surface generated when two curves are revolved about an axis.

SurfaceOfRevolution[{2Sin[x],Sin[x]},{x,0,5Pi/2},{1,0,0}];

With two curves, TracePlot->True produces a trace of the region bounded by the two curves.

SurfaceOfRevolution[{2Sin[x],Sin[x]},{x,0,5Pi/2},
	{1,0,0},TracePlot->True];

Here is a plot of the surface generated when the curves y = 2 Sin[x] and y = Sin[x] are revolved about the line y = 3.

SurfaceOfRevolution[{2Sin[x],Sin[x]},{x,0,5Pi/2},
	{1,0,0},LinePoint->{0,3,0},RotationRange->{0,3Pi/2}];

Here is a trace plot of this surface.

SurfaceOfRevolution[{2Sin[x],Sin[x]},{x,0,5Pi/2},
	{1,0,0},LinePoint->{0,3,0},TracePlot->True];

Here is a picture of spherical caps.

SurfaceOfRevolution[{-Sqrt[1-x^2],Sqrt[1-x^2]},{x,0,.5},
	{0,1,0},PlotPoints->5,Orientation->Textbook]

Here is a picture of the unit sphere with two caps removed.

SurfaceOfRevolution[{-Sqrt[1-x^2],Sqrt[1-x^2]},{x,.5,1},
	{0,1,0},PlotPoints->5,Orientation->Textbook,
		RotationRange->{0,3Pi/2}]

Here is a picture of two spherical caps with their caps removed.

SurfaceOfRevolution[{-Sqrt[1-x^2],Sqrt[1-x^2]},{x,.2,.5},
	{0,1,0},PlotPoints->5]

VolumeOfRevolution

?VolumeOfRevolution

Here is a plot of the volume generated when the region bounded by the graph of y = x2 and the x-axis is revolved about the x-axis.

VolumeOfRevolution[{x^2,0},{x,0,1},{1,0,0}]

To include the axis of revolution, set the option DrawAxis->True.

VolumeOfRevolution[{x^2,0},{x,0,1},{1,0,0},DrawAxis->True]

Plotting fewer points will speed up the command.

VolumeOfRevolution[{x^2,0},{x,0,1},{1,0,0},DrawAxis->True,
	PlotPoints->{10,7}]

To see inside the volume, we set the rotation range to -π to π/2.

VolumeOfRevolution[{x^2,0},{x,0,1},{1,0,0},RotationRange->{-Pi,Pi/2}]

We can close the faces of the solid in this picture by setting the option Solid->True.

VolumeOfRevolution[{x^2,0},{x,0,1},{1,0,0},RotationRange->{-Pi,Pi/2},
	Solid->True]

Here is a picture of the volume generated when the region bounded by y = x2 and the x-axis is revolved about the y-axis.

VolumeOfRevolution[{x^2,0},{x,0,1},{0,1,0}]

Setting the option Orientation->Textbook, we obtain a more familial picture.

VolumeOfRevolution[{x^2,0},{x,0,1},{0,1,0},Orientation->Textbook]

Here is a view of the inside with the axis shown.

VolumeOfRevolution[{x^2,0},{x,0,1},{0,1,0},Orientation->Textbook,
RotationRange->{0,3Pi/2},DrawAxis->True]

Here is a picture of the volume removed when a hole of radius 1/2 is bored through the center of a sphere of radius 1.

VolumeOfRevolution[{-Sqrt[1-x^2],Sqrt[1-x^2]},{x,0,.5},
	{0,1,0},PlotPoints->5,Orientation->Textbook]

Here is a picture of the volume generated when the region between y = x and y = x Log[x] is revolved about the y-axis with a textbook orientation.

VolumeOfRevolution[{x, x Log[x]},{x,0,1},{0,1,0},
	PlotPoints->5,Orientation->Textbook,RotationRange->{0,3Pi/2}];

ParaSurfaceOfRevolution

?ParaSurfaceOfRevolution

Here is one quarter of an ellipse.

ParametricPlot[{Cos[t],3Sin[t]},{t,0,Pi/2},AspectRatio->Automatic]

Here is half an ellipsoid that results from revolving a quarter of this ellipse around the y-axis.  We view the ellipsoid using the textbook orientation.

ParaSurfaceOfRevolution[{Cos[t],3Sin[t]},{t,0,Pi/2},
	{0,1,0},PlotPoints->{9,9},Orientation->Textbook]

ParaSurfaceOfRevolution[{Cos[t],3Sin[t]},{t,0,Pi/2},
	{0,1,0},PlotPoints->{9,9},Orientation->Textbook,
	RotationRange->{0,3Pi/2}]

Here is the picture from the standard Mathematica orientation.

ParaSurfaceOfRevolution[{Cos[t],3Sin[t]},{t,0,Pi/2},
	{0,1,0},PlotPoints->{9,9},RotationRange->{0,3Pi/2}]

Here is one quarter of a four leafed rose.

ParametricPlot[{Cos[t]Cos[2t],Sin[t]Cos[2t]},
	{t,0,Pi/2},AspectRatio->Automatic]

Here is the result of revolving this curve about the y-axis.

ParaSurfaceOfRevolution[{Cos[t]Cos[2t],Sin[t]Cos[2t]},
	{t,0,Pi/2},{0,1,0},PlotPoints->9]

Here is the surface obtained by revolving this curve about the line y = x.

ParaSurfaceOfRevolution[{Cos[t]Cos[2t],Sin[t]Cos[2t]},
	{t,0,Pi/2},{1,1,0},PlotPoints->9]

The region between a circle and an ellipse revolved about the y-axis.

ParaSurfaceOfRevolution[{{Cos[t],Sin[t]},{Cos[t],2Sin[t]}},
	{t,0,Pi/2},{0,1,0},PlotPoints->{9,9},RotationRange->{0,3Pi/2}]

ParaSurfaceOfRevolution[{{Cos[t],Sin[t]},{Cos[t],2Sin[t]}},
	{t,0,Pi/2},{0,1,0},PlotPoints->{9,9},TracePlot->True]

ParaSurfaceOfRevolution[{{Cos[t],Sin[t]},{Cos[t],2Sin[t]}},
	{t,0,Pi/2},{0,1,0},
	PlotPoints->{9,9},TracePlot->True,Orientation->Textbook]

ParaVolumeOfRevolution

?ParaVolumeOfRevolution

Here is the volume generated when the region between the circle x = Cos[t], y = Sin[t] and the ellipse x = 3 Cos[t], y = Sin[t] is revolved about the y-axis.

ParaVolumeOfRevolution[{{Cos[t],Sin[t]},{3Cos[t],Sin[t]}},{t,0,Pi/2},{0,1,0}]

Here we set the rotation range so we can see inside.

ParaVolumeOfRevolution[{{Cos[t],Sin[t]},{3Cos[t],Sin[t]}},{t,0,Pi/2},{0,1,0},
	RotationRange->{0,3Pi/2}]

Here we show three quarters of the volume between the unit sphere and an ellipsoid.

ParaVolumeOfRevolution[{{Cos[t],Sin[t]},{3Cos[t],Sin[t]}},{t,-Pi/2,Pi/2},{0,1,0},
	RotationRange->{0,3Pi/2}]

Here is a trace plot of the region.

ParaVolumeOfRevolution[{{Cos[t],Sin[t]},{3Cos[t],Sin[t]}},{t,-Pi/2,Pi/2},{0,1,0},
	RotationRange->{0,3Pi/2},TracePlot->True]

PolarPlot

?PolarPlot

PolarPlot[Sin[t]^2,{t,0,2Pi},AspectRatio->Automatic,
	PlotRange->All]

PolarPlot[{Sin[2t],Cos[2t]},{t,0,2Pi},AspectRatio->Automatic,
	PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0]}]

DirPolarPlot

?DirPolarPlot

DirPolarPlot[Sin[t]^2,{t,0,2Pi}]

DirPolarPlot[Sin[t]^2,{t,0,2Pi},AspectRatio->Automatic,
	PlotRange->All,PlotStyle->Thickness[.007],Colors->{Hue,0,.8}]

Here is the same curve with ArrowHeads->False.

DirPolarPlot[Sin[t]^2,{t,0,2Pi},AspectRatio->Automatic,
	PlotRange->All,ArrowHeads->False,Colors->{Hue,0,.8}]

Here is a plot of two curves with a style set for the second curve.

DirPolarPlot[{Sin[2t],Cos[2t]},{t,0,2Pi},AspectRatio->Automatic,
	PlotStyle->{Automatic,{Thickness[.01]}}]

Here we set Colors->{Hue,0,.9} and apply a style.

DirPolarPlot[{Cos[2t],1 + Cos[4t]},{t,0,2Pi},
	Colors->{Hue,0,.9},PlotStyle->Thickness[.015],
	AspectRatio->Automatic]

DirParametricPlot

?DirParametricPlot

Here is a curve with one style set.

DirParametricPlot[{Cos[t] Cos[2t],Sin[t]},{t,0,2Pi},
	AspectRatio->Automatic,PlotStyle->Thickness[.007]]

PlotPoints->{pp,parrow} uses pp plotpoints and parrow arrowheads.  Each component  must be a number.  PlotPoints->pp used pp plotpoints and pp/3 arrowheads.

DirParametricPlot[{Cos[t] Cos[2t],Sin[t]},{t,0,2Pi},
	AspectRatio->Automatic,PlotStyle->Thickness[.007],
	PlotPoints->{50,10}]

Here is the same curve with ArrowHeads->False.

DirParametricPlot[{Cos[t] Cos[2t],Sin[t]},{t,0,2Pi},
	AspectRatio->Automatic,ArrowHeads->False,
	PlotStyle->Thickness[.007]]

Here is how to change the color function from GrayLevel to Hue.

DirParametricPlot[{Cos[t] Cos[2t],Sin[t]},{t,0,2Pi},
	AspectRatio->Automatic,Colors->{Hue,0,.8},
	PlotStyle->Thickness[.007]]

When two curves are given, the first style applies to the first curve, and the second style applies to the second curve.

DirParametricPlot[{{Cos[t] Cos[2t],Sin[t]},
					{Cos[t] Cos[4t],Sin[t]}},{t,0,2Pi},
	AspectRatio->Automatic,
	PlotStyle->{Thickness[.007],Thickness[.015]}]

If just one style is specified, it is applied to the both curve.

DirParametricPlot[{{Cos[t],2Sin[t]},{Cos[t],Sin[t]}},{t,0,2Pi},
	AspectRatio->Automatic,PlotStyle->Thickness[.017]]

Here is how to apply a style just to the second curve.

DirParametricPlot[{{Cos[t],2Sin[t]},{Cos[t],Sin[t]}},{t,0,2Pi},
	AspectRatio->Automatic,
	PlotStyle->{Automatic,Thickness[.017]}]

PlotVector

?PlotVector

PlotVector[{{0,0},{1,1}},AspectRatio->Automatic]

PlotVector[{{{0,0},{1,1}},{{2,-1},{.7,0}}},AspectRatio->Automatic,
	PlotStyle->RGBColor[1,0,0],Axes->Automatic]

PlotVector[{{{0,0},{1,1}},{{2,-1},{.7,0}}},AspectRatio->Automatic,
	PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},
	Axes->Automatic]

PlotVector[Table[{{i,i^2},{i+.1,(i+.1)^2}},{i,0,1,.1}],
	AspectRatio->Automatic,
	PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},
	Axes->Automatic]

PlotTangentVector

?PlotTangentVector

Here is a curve and several tangent vectors with styles set for each tangent vector.

PlotTangentVector[{Cos[Pi t^2],Sin[Pi t]},{t,0,2},
	TangentPoints->{.6,.8,1},
	AspectRatio->Automatic,
	TangentStyle->{GrayLevel[0],GrayLevel[1/3],GrayLevel[2/3]}]

Here is a curve and several tangent lines with a style set for the curve.

PlotTangentVector[{Cos[Pi t^2],Sin[Pi t]},{t,0,2},
	TangentPoints->{.6,.8,1},
	AspectRatio->Automatic,
	PlotStyle->Thickness[.01]]

Finally, here is a curve and several tangent lines with styles set for both.

PlotTangentVector[{t - 2Cos[t],1 - 2Sin[t]},{t,0,3Pi},
	TangentPoints->{Pi/2,Pi,3Pi/2,2Pi,5Pi/2}, 
	TangentStyle->{RGBColor[1,0,0], RGBColor[1,.5,0],RGBColor[0,1,0], 
		RGBColor[0,1,.7],RGBColor[0,0,1]},
	PlotStyle->Thickness[.007],
	AspectRatio->Automatic,PlotRange->All]

PlotTangentVector[{Cos[t],Exp[t/12]Sin[t]},{t,0,3Pi},
	TangentPoints->{0,Pi/2,Pi,2Pi,11Pi/4}, 
	TangentStyle->{RGBColor[1,0,0], RGBColor[1,.5,0],RGBColor[0,1,0], 
		RGBColor[0,1,.7],RGBColor[0,0,1]},
	PlotStyle->Thickness[.007]]

PlotTaylorPoly

?PlotTaylorPoly

Here is a plot of y = Sin[x] together with its 1st, 3rd, and 5th degree Taylor polynomial centered at x0 = 0.

PlotTaylorPoly[Sin[x],{x,-2Pi,2Pi},Center->0,
	Degrees->{1,3,5}]

Here is how to assign a different style to each Taylor polynomial.

PlotTaylorPoly[Sin[x],{x,-2Pi,2Pi},Center->0,Degrees->{1,3,5},
	PolyStyle->{GrayLevel[0],GrayLevel[1/3],GrayLevel[2/3]}]

Here we assign styles to the Taylor polynomials and the curve.

PlotTaylorPoly[Sin[x],{x,-2Pi,2Pi},Center->0,Degrees->{1,3,5},
	PolyStyle->{GrayLevel[0],GrayLevel[1/3],GrayLevel[2/3]},
	PlotStyle->Thickness[.007]]

PlotLeftApprox and PlotRightApprox

?PlotLeftApprox

?PlotRightApprox

PlotLeftApprox[Log[x+1] Cos[x],{x,0,2Pi,20}]

We can use the option AreaStyle to change the color of the region.

PlotLeftApprox[Log[x+1] Cos[x],{x,0,2Pi,20},
	AreaStyle->RGBColor[0,.6,.3]]

We can change both the color of the region and the style of the curve.

PlotLeftApprox[Log[x+1] Cos[x],{x,0,2Pi,20},
	AreaStyle->RGBColor[0,.6,.3],
	PlotStyle->{{Thickness[.01],RGBColor[1,0,0]}}]

You can surpress the graph by setting the option Graph->False.

PlotLeftApprox[Log[x+1] Cos[x],{x,0,2Pi,20},Graph->False]

An improper integral.

PlotLeftApprox[1/Sqrt[x] Cos[2Pi x],{x,0,.2,60},
	PlotRange->{0,65}]

NIntegrate[1/Sqrt[Abs[x]] Cos[2Pi x],{x,-.2,0,.2}]

PlotLeftApproxR and PlotRightApproxR

?PlotLeftApproxR

?PlotRightApproxR

PlotLeftApproxR and PlotRightApproxR are similar to PlotLeftApprox and PlotRightApprox except that the user specifies the maximum length of any subinterval instead of the number of subintervals.

PlotLeftApproxR[Log[x+1] Cos[x],{x,0,2Pi,.5},
	PlotStyle->RGBColor[0,1,.3]]

PlotLeftApproxR[1/Sqrt[x] Cos[2Pi x],{x,0,.2,.05},
	PlotRange->{0,65}]

PlotLowerApprox and PlotUpperApprox

?PlotLowerApprox

?PlotUpperApprox

PlotLowerApprox[Sin[3x],{x,-Pi/2,Pi,10},
   PlotStyle->RGBColor[0,1,0]]

The user can request that more points be sampled to find the minimum.

PlotLowerApprox[Sin[3x],{x,-Pi/2,Pi,10,5}]

Setting Graph->False will surpress the graph.

PlotLowerApprox[Sin[3x],{x,-Pi/2,Pi,200,5},Graph->False]

NIntegrate[Sin[3x],{x,-Pi/2,Pi}]

PlotLowerApproxR and PlotUpperApproxR

?PlotLowerApproxR

?PlotUpperApproxR

PlotLowerApproxR and PlotUpperApproxR are similar to PlotLowerApprox and PlotLowerApprox except that the user specifies the maximum length of any subinterval instead of the number of subintervals.

PlotLowerApproxR[Sin[3x],{x,-Pi/2,Pi/2,.5},
				AreaStyle->{RGBColor[0,1,0]}]

PlotLowerApproxR[Sin[3x],{x,-Pi/2,Pi,.5,6}]

PlotMidpointApprox

?PlotMidpointApprox

PlotMidpointApprox[Sin[x^2], {x,0,3,10},
	AspectRatio->Automatic]

PlotMidpointApprox[Log[x]/Sqrt[x], {x,0,1,10}]

PlotMidpointApprox[Log[x]/Sqrt[x], {x,0,1,10},
	PlotRange->All]

NIntegrate[Log[x]/Sqrt[x], {x,0,2}]

PlotMidpointApproxR

?PlotMidpointApproxR

PlotMidpointApproxR is similar to PlotMidpointApprox, except that the user specifies the maximum length of any subinterval instead of the number of subintervals.

PlotMidpointApproxR[Sin[x^2], {x,0,4,.5},
	AspectRatio->Automatic]

PlotMidpointApproxR[Log[x]/Sqrt[x], {x,0,2,.5}]

NIntegrate[Log[x]/Sqrt[x], {x,0,2}]

PlotRiemannApprox

?PlotRiemannApprox

PlotRiemannApprox[Sin[x^2], {x,0,4,10},
	AspectRatio->Automatic,AreaStyle->RGBColor[1,0,1]]

PlotRiemannApprox[Log[x], {x,0,1,6}]

PlotRiemannApproxR

?PlotRiemannApproxR

PlotRiemannApproxR is similar to PlotRiemannApprox, except that the user specifies the maximum length of any subinterval instead of the number of subintervals.

PlotRiemannApproxR[Sin[x^2], {x,0,4,.5},
	AspectRatio->Automatic,AreaStyle->RGBColor[1,0,1]]

PlotRiemannApproxR[Sqrt[x], {x,0,2,.3},
	AspectRatio->Automatic]

PlotSimpsonApprox

?PlotSimpsonApprox

PlotSimpsonApprox[Sin[x^2],{x,0,4,14},AreaStyle->RGBColor[1,0,0],
	PlotStyle->Thickness[.01],PolyStyle->RGBColor[0,1,0]]

PlotSimpsonApprox[Sin[x^2],{x,0,4,14},Graph->False]

PlotTrapApprox

?PlotTrapApprox

PlotTrapApprox[Sin[x^2],{x,0,4,14}]

PlotTrapApprox[Sin[x^2],{x,0,4,14},
	AreaStyle->RGBColor[0,0,1],
	PlotStyle->{{Thickness[.007],RGBColor[1,0,0]}}]

PlotTrapApprox[Sin[x^2],{x,0,4,14},Graph->False]

Multivariable Calculus Examples

PlotPlane

?PlotPlane

PlotPlane[(x+y)/2,{x,-1,1},{y,-1,1},
	BoxRatios->Automatic]

Plot of several planes:

PlotPlane[{(x+y)/2,y-x/3,(2-y)/4},{x,-1,1},{y,-1,1},
	BoxRatios->Automatic]

PlotSeveralSurfaces

?PlotSeveralSurfaces

Two surfaces defined by functions of two variables:

PlotSeveralSurfaces[{y Exp[x]/2,Cos[Pi(x + y)]},
	{x,-1,1},{y,-1,1},BoxRatios->Automatic,PlotPoints->9]

ParametricPlot3D

?ParametricPlot3D

ParametricPlot3D has been modified so that more than one graphics directive can be given as a fourth argument.

ParametricPlot3D[{Cos[2t] Cos[t], Cos[2t] Sin[t], Sin[2t],
	{Hue[.8t/(2Pi)],Thickness[.005t]}},{t,0,2Pi}]

ParametricPlot3D[{
{Cos[2t] Cos[t], Cos[2t] Sin[t], Sin[2t],{Dashing[{.01,.03}],Hue[.8t/(2Pi)]}},
{Cos[t],Cos[t],Sin[2t],{Hue[.8t/(2Pi)],Thickness[.02]}}},{t,0,2Pi}]

PlotVector3D

?PlotVector3D

PlotVector3D[{{2,2,1},{0,0,2}},Axes->Automatic]

PlotVector3D[{{{0,0,0},{1,1,1}},{{1,2,3},{3,4,0}},{{0,0,0},{3,2,0}}},
	PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0],RGBColor[0,0,1]},
	Axes->Automatic];

Here we set fewer styles than the number of vectors.

PlotVector3D[{{{0,0,0},{1,1,1}},{{1,2,3},{3,4,0}},{{0,0,0},{3,2,0}}},
	PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},
	Axes->Automatic];

PlotTangentVector3D

?PlotTangentVector3D

PlotTangentVector3D[{Cos[2Pi t],Sin[2Pi t],t^3},{t,-1,2},
	TangentPoints->{-1,1/4,5/4}]

Here we set a style for each of the vectors.

PlotTangentVector3D[{Cos[2Pi t],Sin[2Pi t],t^3},{t,-1,2},
	TangentPoints->{-1,1/4,5/4},
	TangentStyle->{GrayLevel[0],GrayLevel[.3],GrayLevel[.6]}]

Here we set fewer styles than the number of vectors.

PlotTangentVector3D[{Cos[2Pi t],Sin[2Pi t],t^3},{t,-1,2},
	TangentPoints->{-1,1/4,5/4},
	TangentStyle->{GrayLevel[0],GrayLevel[.6]}]

Here we set a style for the vectors and the curve.

PlotTangentVector3D[{2Sin[t]^2,Sin[2t],2Cos[t],Thickness[.007]},{t,0,2Pi},
	TangentPoints->{0,1,2,3,4},
	TangentStyle->{RGBColor[1,0,0],RGBColor[.5,.5,0],
				RGBColor[0,.5,.5],RGBColor[0,.5,1],RGBColor[0,0,1]}];

PlotTangentVector3D[{Cos[t],Sin[t],Cos[t] Sin[3 t],Thickness[.007]},{t,0,2Pi},
	TangentPoints->Range[0,2Pi,Pi/8],
	BoxRatios->{1,1,1},PointStyle->PointSize[.02]]

PlotCylinder

?PlotCylinder

Graph of a vertical cylinder:

PlotCylinder[{Cos[t],Sin[t]},{t,0,2Pi},{z,0,2},BoxRatios->Automatic]

PlotCylinder[{t,Sin[Pi t]},{t,0,2},{z,0,1}]

Graph of two vertical cylinders together:

PlotCylinder[{{t,Sin[Pi t]},{Cos[Pi t] + 2,Sin[Pi t]}/2},{t,0,2},{z,0,1}];

A cylinder with varing height.

PlotCylinder[{Cos[Pi t],Sin[Pi t]},Cos[2Pi t],{t,0,2}];

PlotCylinder[{{Cos[t],Sin[t]},{2Cos[t],Sin[t]}},Sin[2t] ,
	{t,0,2Pi}];

PlotCylinderSurface

?PlotCylinderSurface

Here is a plot of a surface cut by a cylinder:

PlotCylinderSurface[x^2 - y^2,{x,-2,2},{y,-2,2},
		{Cos[t],Sin[t]},{t,0,2Pi}]

Setting the option PlotPoints -> {a,b} sets plotpoints to a for the surface and b for the cylinder.

PlotCylinderSurface[x^2 - y^2,{x,-2,2},{y,-2,2},
	{Cos[t],Sin[t]},{t,0,2Pi},PlotPoints->{5,10}]

Here is a surface cut by two cylinders with PlotPoints for the surface set to 5.

PlotCylinderSurface[x^2 - y^2,{x,-1,1},{y,-1,1},
	{ {Cos[Pi/2 + Pi t],Sin[Pi/2 + Pi t]},{Cos[Pi t]^2,t - .5} },{t,0,1},
	PlotPoints->5]

We can set PlotPoints just for the cylinders as follows.

PlotCylinderSurface[x^2 - y^2,{x,-1,1},{y,-1,1},
	{ {Cos[Pi/2 + Pi t],Sin[Pi/2 + Pi t]},{Cos[Pi t]^2,t - .5} },{t,0,1},
	PlotPoints->{Automatic,10}]

PlotSectionSurface

?PlotSectionSurface

VPlane

?VPlane

Here is a section of a surface by a vertical plane (not parallel to either the x- or the y-axis):

PlotSectionSurface[x^2 - y^2,{x,-1,1},{y,-1,1},VPlane,{(x - 1)/2}]

Here are two such sections with PlotPoints for the surface set.

PlotSectionSurface[x^2 - y^2,{x,-1,1},{y,-1,1},VPlane,{-x,-3x - 2},
	PlotPoints->9,BoxRatios->Automatic,AxesLabel->{"x","y","z"}]

HPlane

?HPlane

Here is a graph of a surface cut by two horizontal planes.

PlotSectionSurface[x^2 - y^2, {x,-2,2},{y,-2,2},HPlane,{-1,2},
	BoxRatios->Automatic,PlotPoints->9,AxesLabel->{"x","y","z"}];

Two of the sections requested in the following command is outside the plot range.

PlotSectionSurface[x^2 - y^2, {x,-2,2},{y,-2,2},HPlane,{-5,-1,2,5},
	BoxRatios->Automatic,PlotPoints->9,AxesLabel->{"x","y","z"}];

We can include these sections in the plot by setting the option PlotRange->All.

PlotSectionSurface[x^2 - y^2, {x,-2,2},{y,-2,2},HPlane,{-5,-1,2,5},
	BoxRatios->Automatic,PlotPoints->9,AxesLabel->{"x","y","z"},
	PlotRange->All];

XPlane

?XPlane

PlotSectionSurface[x^2 + y^2, {x,-1,1},{y,-1,1},XPlane,{-.75,.5},
	PlotPoints->9,BoxRatios->Automatic,AxesLabel->{"x","y","z"}]

One of the requested sections is not within the plot range of the surface.

PlotSectionSurface[x^2 + y^2, {x,-1,1},{y,-1,1},XPlane,{-.75,.5,2},
	PlotPoints->9,BoxRatios->Automatic,AxesLabel->{"x","y","z"}]

YPlane

?YPlane

Here is a graph of a surface cut by two planes parallel to the plane y = 0.

PlotSectionSurface[x^2 + y^2, {x,-1,1},{y,-1,1},YPlane,{-.5,.85},
	PlotPoints->9,BoxRatios->Automatic,
		ViewPoint->{1.2,-1.2,1.7},AxesLabel->{"x","y","z"}];

One of the sections requested is outside the plot range of the surface.

PlotSectionSurface[x^2 + y^2, {x,-1,1},{y,-1,1},YPlane,{-.5,.85,2},
	PlotPoints->9,BoxRatios->Automatic,
		ViewPoint->{1.2,-1.2,1.7},AxesLabel->{"x","y","z"}];

ObliquePlane

?OPlane

Hre is a graph cut by an oblique plane.

PlotSectionSurface[Sin[x y],{x,0,Pi},{y,0,Pi},OPlane,{x + y - 1},
		AxesLabel -> {"x","y","z"}]

Here is a surface cut by two oblique planes.

PlotSectionSurface[Sin[x y],{x,0,Pi},{y,0,Pi},OPlane,{x/2 - 1,y/2-1},
		BoxRatios->Automatic,PlotPoints->9,AxesLabel -> {"x","y","z"}]

ParaPlotSectionSurface

?ParaPlotSectionSurface

VPlane

?VPlane

Here is a cone cut by a vertical plane that is parallel to the axis of the cone.  The intersection is an hyperbola.  Note that the variable used for the plane must be specified.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	VPlane,{x - .5},{x,y},PlotPoints->{15,3}]

If the vertical plane passes through the origin, then the section is two lines through the origin.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	VPlane,{x},{x,y},PlotPoints->{Automatic,3}]

HPlane

?HPlane

Here is a cone cut by a horizontal plane.  The intersection is an circle.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	HPlane,.5,{x,y},PlotPoints->{15,3}]

When the plane passes through the vertex of the cone, the intersection is a point.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	HPlane,0,{x,y},PlotPoints->{15,3}]

XPlane

?XPlane

The intersection of planes of the form x = a with a cone generate either hyperbolas or lines.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	XPlane,1/2,{x,y},PlotPoints->{15,3}]

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	XPlane,0,{x,y},PlotPoints->{15,3}]

YPlane

?YPlane

The intersection of planes of the form y = b with the cone result in hyperbolas or intersecting lines.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	YPlane,-1/2,{x,y},PlotPoints->{15,3}]

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	YPlane,0,{x,y},PlotPoints->{15,3}]

ObliquePlane

?OPlane

Cutting the cone with a plane not passing through the vertex of the cone and not parallel to an axis of the cone will give an ellipse.  Note that the variables used to specify the plane must be given in a list.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,0,3},
	OPlane,{y/2 + .5},{x,y},PlotPoints->{15,2},ViewPoint->{1.3,-2.4,2.8}]

Increasing the slope of the plane will elongate the ellipes.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,0,3},
	OPlane,{3y/4 + .5},{x,y},PlotPoints->{15,2},ViewPoint->{1.3,-2.4,2.8}]

When the plane is parallel to the side of the cone we generate a parabola.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,0,3},
	OPlane,{y + .5},{x,y},PlotPoints->{15,2},ViewPoint->{1.3,-2.4,2.8}]

When the plane passes through the vertex of the cone and is parallel to the side of the cone we generate a single line.

ParaPlotSectionSurface[{r Cos[t],r Sin[t],r},{t,0,2Pi},{r,-1,1},
	OPlane,x,{x,y},PlotPoints->{15,3}]

PlotCurveSurface

?PlotCurveSurface

Here is a curve and a surface.  A style has been set for the curve and PlotPoints has been set to 9 for the surface and Automatic for the curve.

PlotCurveSurface[x^2 - y^2,{x,-1,1},{y,-1,1},
	{t, t,Sin[2Pi t],RGBColor[1,0,0]},{t,-1,1},
	BoxRatios->Automatic,PlotPoints->{9,Automatic}]

Here are two curves on a surface with options set for the curves.

PlotCurveSurface[x^2-y^2,{x,-1,1},{y,-1,1},
			{ {Cos[t],Sin[t],Cos[2t],{RGBColor[1,0,0]}},
			   {.5Cos[t],.5Sin[t],.25Cos[2t],{Thickness[.015]}} },{t,0,2Pi},
		PlotPoints->{9,Automatic},BoxRatios->Automatic]

Here is the plot with the surface displayed as a wire frame.

PlotCurveSurface[x^2-y^2,{x,-1,1},{y,-1,1},
			{ {Cos[t],Sin[t],Cos[2t],{RGBColor[1,0,0]}},
			   {.5Cos[t],.5Sin[t],.25Cos[2t],{Thickness[.015]}} },{t,0,2Pi},
		PlotPoints->{9,Automatic},BoxRatios->Automatic,
		WireFrame->True];

ParaPlotCurveSurface

One curve and a surface defined parametrically:

?ParaPlotCurveSurface

Here is a spiral on a cone.

ParaPlotCurveSurface[{u Cos[v],u Sin[v],2u},{u,-1,0},{v,0,2Pi},
				{t Cos[4Pi t],t Sin[4Pi t],2t},{t,-1,0}]

We can adjust the PlotPoints for the curve and the surface as well as adjust the style of the curve.

ParaPlotCurveSurface[{u Cos[v],u Sin[v],2u},{u,-1,0},{v,0,2Pi},
			{t Cos[4Pi t],t Sin[4Pi t],2t,{Thickness[.01],RGBColor[1,0,0]}},{t,-1,0},
				PlotPoints->{{2,15},100}]

Here is a sprial on a torus.

ParaPlotCurveSurface[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},{u,0,2Pi},{v,0,2Pi},
	{(2 + Cos[14t])Cos[t],(2 + Cos[14t])Sin[t],Sin[14t],{Thickness[.01]}},
	{t,0,2Pi},PlotPoints->{Automatic,300}]

Here is the plot with the surface displayed as a wire frame.

ParaPlotCurveSurface[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},{u,0,2Pi},{v,0,2Pi},
	{(2 + Cos[14t])Cos[t],(2 + Cos[14t])Sin[t],Sin[14t],{Thickness[.01]}},
	{t,0,2Pi},PlotPoints->{Automatic,300},WireFrame->True]

Here are two spirals on a cylinder.

ParaPlotCurveSurface[{u,Sin[v],Cos[v]},{u,-2,2},{v,0,2Pi},
	{ {t,Sin[Pi t],Cos[Pi t],{Thickness[.01]}},
               {-t,Sin[2Pi t],Cos[2Pi t],{RGBColor[1,0,1],Thickness[.01]}} },
        {t,-2,2}];

PlotTangentPlane

?PlotTangentPlane

Here is a surface with tangent plane.

PlotTangentPlane[Sin[x] Cos[y],{x,0,Pi},{y,-Pi,0},
	TangentPoints->{Pi/2,-Pi/4},BoxRatios->Automatic]

Setting the option PlaneSize->All will cause the plane to be drawn in the entire box.

PlotTangentPlane[Sin[x] Cos[y],{x,0,Pi},{y,-Pi,0},
	TangentPoints->{2,-1},BoxRatios->Automatic,PlaneSize->All]

Here is a surface with tangent planes drawn at two points.  One style has been set for the two points.

Clear[f,x,y];
f[x_,y_] := x^2 y^2/(x^2 + y^2);
f[0,0] := 0

PlotTangentPlane[f[x,y],{x,-1,1},{y,-1,1},
	TangentPoints->{{0,0},{-.75,.75}},
	PointStyle->{{PointSize[.03],RGBColor[1,0,0]}}];

ParaPlotTangentPlane

?ParaPlotTangentPlane

Here is a surface defined parametrically  together with tangent planes at two points.

ParaPlotTangentPlane[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},
		{u,0,2Pi},{v,0,2Pi},TangentPoints->{{7Pi/4,Pi/3},{3Pi/2,Pi/4}},
			PlotPoints->15]

Here is the same surface with the option PlaneSize->All.

ParaPlotTangentPlane[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},
		{u,0,2Pi},{v,0,2Pi},TangentPoints->{{7Pi/4,Pi/3},{3Pi/2,Pi/4}},
			PlotPoints->15,PlaneSize->All]

Here we set the same style for two points.

ParaPlotTangentPlane[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},
		{u,0,2Pi},{v,0,2Pi},TangentPoints->{{7Pi/4,Pi/3},{3Pi/2,Pi/4}},
			PlotPoints->15,
			PointStyle->{{PointSize[.03],RGBColor[1,0,0]}}]

Sometimes, the points don't show up due to numerical errors.  Usually, plottting more points will solve the problem.

ParaPlotTangentPlane[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},
		{u,0,2Pi},{v,0,2Pi},TangentPoints->{{Pi,Pi},{Pi/4,3Pi/4}}]

ParaPlotTangentPlane[{(2 + Cos[v])Cos[u],(2 + Cos[v])Sin[u],Sin[v]},
		{u,0,2Pi},{v,0,2Pi},TangentPoints->{{Pi,Pi},{Pi/4,3Pi/4}},
			PlotPoints->21]

CylindricalPlot

?CylindricalPlot

Surfaces

The equation z = r in cylindrical coordinates defines a cone.

CylindricalPlot[r,{r,-1,1},{t,0,2Pi},BoxRatios->Automatic];

Here is a torus plotted in cylindrical coordinates.

CylindricalPlot[{ Sqrt[(1/4)^2 - (r - 3/4)^2],
				-Sqrt[(1/4)^2 - (r - 3/4)^2]},
	{r,1/2,1},{t,0,2Pi},PlotPoints->15]

Curves

A curve in cylindrical coordinates.

CylindricalPlot[ {1,t,Sin[5 t],RGBColor[1,0,0]},{t,0,2Pi}]

CylindricalPlot[
	{{Sqrt[t],2t,Sin[5t],{Thickness[.007],Hue[t/N[2Pi]]}}, 
	 {1,t,Sin[3 t]}},{t,0,2Pi}]

SphericalPlot

?SphericalPlot

Surfaces

SphericalPlot[{1,2},{t,0,3Pi/2},{p,0,Pi}];

SphericalPlot[1 + p Cos[p]^2,{t,0,3Pi/2},{p,0,Pi}];

SphericalPlot[{2,1 + p Cos[p]^2},{t,0,3Pi/2},{p,0,Pi}];

SphericalPlot[(2-Cos[t])Sin[p],{t,0,2Pi},{p,0,Pi}];

SphericalPlot[(2-Cos[t])(Sin[p]),{t,-Pi/2,Pi},{p,0,Pi},
	ViewPoint->{-1.300, -2.400, 2.000}];

Curves

SphericalPlot[{1,2t,t/10,Hue[t/10/Pi]},{t,0,10Pi},PlotPoints->175]

SphericalPlot[{{1,t/5,Pi/2 Sin[2t/5],{Thickness[.007],RGBColor[0,1,0]}},
	{1,2t,t/10,Hue[t/10/Pi]}},{t,0,10Pi},PlotPoints->175]

LevelCurve

?LevelCurve

LevelCurve[Sin[Pi x] Cos[Pi y],{x,-1,1},{y,-1,1},{z,.5},
	ContourStyle->RGBColor[1,0,0]];

LevelCurve[{x^2 - y,x y},{x,-1,1},{y,-1,1},{z,0},
	ContourStyle->{RGBColor[1,0,0],RGBColor[0,1,0]}];

PlotConstraint

?PlotConstraint

PlotConstraint[x y,{x,-2,2},{y,-2,2},x^2 + y^2 - 1]

PlotConstraint[x y,{x,-2,2},{y,-2,2},{x^2/2 + 2y^2 - 1, x^2/4 + y^2 - 1},
	PlotStyle->RGBColor[1,0,0]]

ParaPlotConstraint

?ParaPlotConstraint

ParaPlotConstraint[Sin[x y],{x,-2,2},{y,-2,2},
	Table[r {Cos[t],Sin[t]},{r,.5,1.5,.5}],{t,0,2Pi},
	PlotStyle->{RGBColor[1,0,0]}]

ParaPlotConstraint[Sin[x y],{x,-2,2},{y,-2,2},
	Table[r {Cos[t],Sin[t]},{r,.5,1.5,.5}],{t,0,2Pi},
	PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0],RGBColor[0,0,1]}]

SDTest

?SDTest

Here is a function with a local min and a saddle.

Plot3D[x^3 - y^3 + 2x y,{x,-1,2},{y,-2,1},BoxRatios->{1,1,1}]

grad = Grad[x^3 - y^3 + 2x y,{x,y}]

criticalpts = Solve[grad == {0,0},{x,y}]

SDTest[x^3 - y^3 + 3x y,{x,y},criticalpts]

Here is a more complicated example.

Plot3D[y^2(y - x^3)/(1 + x^2 + y^4),{x,-2,2},{y,-2,2},
	BoxRatios->Automatic]

grad = Grad[x^2(x - y)/(1 + x^2 + y^4),{x,y}]

cpts = NSolve[grad == {0,0},{x,y}]

SDTest automatically calls SelectReal to pick out the real solutions.

SDTest[x^2 y/(1 + x^2 + y^2),{x,y},cpts]

Grad

?Grad

Grad[Sin[x y],{x,y}]

Grad[x Sin[y z] + Cos[x y z],{x,y,z}]

Hessian

?Hessian

Hessian[Sin[x y],{x,y}]

JacobianMatrix

?JacobianMatrix

JacobianMatrix[{r Cos[t],r Sin[t]},{r,t}]

Divergence

?Divergence

Divergence[{x y z,x y^2 z,x y z^3},{x,y,z}]

Curl

?Curl

Curl[{x y z,x^2 y^2 z^2,y^2 z^3},{x,y,z}]

Laplacian

?Laplacian

Laplacian[{x^2 y^3,y^2 z^3,x y z^4},{x,y,z}]

Norm

?Norm

Norm[{a,b,c,d}]

CrossProduct

?CrossProduct

CrossProduct[{a1,a2,a3},{b1,b2,b3}]

Initialization for Quadrics

The next set of examples illustrates the commands PlotConicSection and PlotQuadricSurface defined in the package Quadrics.m.  That package is in the folder KnoxPackages which must be loaded in the Packages folder in the Mathematica folder.

Needs["KnoxPackages`Quadrics`"]

Conic Sections Examples

Lines

PlotConicSection[3(x + 5/3) - 5(w - 23/2) - 1, {x, w},
	DrawAxes->True];

PlotConicSection[ x^2 +  y^2 + 2 x y - 5,{x,y},{u,v},
	PrintDisplay->True,DrawAxes->True];

Ellipse

PlotConicSection[ x^2 +  7y^2 + x + 3y - 5,{x,y},{u,v},
	PrintDisplay->True,DrawAxes->True];

PlotConicSection[ x^2 +  7y^2 + 2 x y + x + 2y - 5,{x,y},{u,v},
	PrintDisplay->True,DrawAxes->True];

Parabola

PlotConicSection[x^2 + Cos[3Pi/5] y - x,
	{x,y},{u,v},PrintDisplay->True,DrawAxes->True];

PlotConicSection[x^2 + 2x y + y^2 - 2x - y - 1,
	{x,y},{u,v},PrintDisplay->True,DrawAxes->True];

Hyperbola

PlotConicSection[x^2 - 2y^2 + 3 + x - 4,{x,y},{u,v},
	PrintDisplay->True,DrawAxes->True];

NPlotConicSection[Sqrt[3]/7 x^2 + Cos[3Pi/5] y + 3 + x y +
	x/Sech[4],{x,y},{u,v},PrintDisplay->True,DrawAxes->True];

Quadric Sections Examples

Ellipsoid

PlotQuadricSurface[3x^2 + 5y^2 + 11z^2 - 1,{x,y,z},{u,v,w}];

NPlotQuadricSurface[3x^2 + 5y^2 + 16z^2 - 3x y - 5x z - 1,
	{x,y,z},{u,v,w},DrawAxes->True,PrintDisplay->True,QuadricPlot->False];

Show[%, QuadricView[QuadricID[]] ]

Hyperboloid of one sheet

PlotQuadricSurface[x^2 + y^2 - z^2 - 1,{x,y,z},DrawAxes->True];

Hyperboloid of two sheets

PlotQuadricSurface[y^2 - z^2 + x^2 + 1,{x,y,z},DrawAxes->True]

NPlotQuadricSurface[y^2 - z^2 + 4x^2 + x z + 1,{x,y,z},
	DrawAxes->True];

Hyperbolic Paraboloid

PlotQuadricSurface[y^2 - x^2 - z, {x,y,z}, DrawAxes->True];

NPlotQuadricSurface[-2 x y - 3 z + 3 y - 2 x - 2 y z -
	 y^2, {x,y,z}, DrawAxes->True,ViewPoint->{-1.3,-2.4,2}];

Elliptic Cylinder

PlotQuadricSurface[10(x + 12)^2 + 55(y - 43)^2 - 81,{x,y,z},
	DrawAxes->True];

Parabolic Cylinder

PlotQuadricSurface[(x)^2 + z,{x,y,z},PrintDisplay->True,DrawAxes->True];

PlotQuadricSurface[(x - 3)^2 - (y + 1) + z,{x,y,z},PrintDisplay->True,DrawAxes->True];

Hyperbolic Cylinder

NPlotQuadricSurface[x^2 - 5y^2 + 24x + 47y + 20x y - 37,{x,y,z},{u,v,w},
	DrawAxes->True,PrintDisplay->True];

Cone

PlotQuadricSurface[7 (z - 4)^2 + 23 y^2 - 3 x^2,{x,y,z}];

PlotQuadricSurface[2 x y + y z + 2 x z, {x, y, z},{u, v, w},
	PrintDisplay->True];

Paraboloid

PlotQuadricSurface[69(x + 10)^2 + 212(z + 8)^2 + 21y + 135,{x,y,z},
	DrawAxes->True];

Planes

PlotQuadricSurface[x^2 - y^2, {x,y,z}, DrawAxes->True];

PlotQuadricSurface[x^2 - x -7, {x,y,z},{u,v,w},
	DrawAxes->True,PrintDisplay->True];

PlotQuadricSurface[x + y + z, {x,y,z}, DrawAxes->True];