MultivariateCalculus
The Student[MultivariateCalculus] package is designed to aid in the teaching and understanding of multivariate calculus concepts. This worksheet demonstrates the basics of this functionality. For more information about the commands in the MultivariateCalculus package, see the command help page. For a general overview, see MultivariateCalculus.
Getting Started
Commands in the MultivariateCalculus package can be referred to using the long form, for example, Student[MultivariateCalculus][ApproximateInt].
However, it is recommended that you load the package first and use the shorter command names.
restart
with⁡StudentMultivariateCalculus:
The MultivariateCalculus package contains tutor routines that act as interfaces to the other MultivariateCalculus routines. Each tutor can be called with no parameters, in which case defaults are used. These parameters can be changed easily in the Maplet application.
The following examples show you how to use the MultivariateCalculus routines.
Taylor Approximations
The MultivariateCalculus package routine TaylorApproximation calculates, plots, or animates Taylor approximations to multivariate functions. The TaylorApproximationTutor routine provides an interface to the TaylorApproximation routine.
TaylorApproximationTutor⁡
TaylorApproximationTutor⁡sin⁡x+y,x,y=1,2,8
The TaylorApproximation routine allows you to calculate, plot, or animate the Taylor approximation, without using the Maplet application interface.
TaylorApproximation⁡sin⁡x+y,x,y=1,0,5
1120⁢cos⁡1⁢y5+124⁢sin⁡1⁢y4+124⁢cos⁡1⁢x−1⁢y4+16⁢sin⁡1⁢x−1⁢y3+112⁢cos⁡1⁢x−12⁢y3−16⁢cos⁡1⁢y3+112⁢cos⁡1⁢x−13⁢y2−12⁢sin⁡1⁢y2−12⁢cos⁡1⁢x−1⁢y2+14⁢sin⁡1⁢x−12⁢y2+124⁢cos⁡1⁢x−14⁢y+cos⁡1⁢y+16⁢sin⁡1⁢x−13⁢y−sin⁡1⁢x−1⁢y−12⁢cos⁡1⁢x−12⁢y+124⁢sin⁡1⁢x−14+1120⁢cos⁡1⁢x−15+sin⁡1+cos⁡1⁢x−1−16⁢cos⁡1⁢x−13−12⁢sin⁡1⁢x−12
TaylorApproximation⁡sin⁡x+y,x,y=1,0,5,output=animation
Cross-Sections
The MultivariateCalculus package has routines to illustrate the concepts of cross-sections. The cross-section routines demonstrate the intersection of any given plane with the curve.
The CrossSectionTutor routine provides and interfaces for the CrossSection.
CrossSectionTutor⁡
CrossSectionTutor⁡x2+y2+z2=4,x+z=2,1,0,x=−2..2,y=−2..2,z=−2..2
The CrossSection routine allows you to plot or animate the cross-sections without using the Maplet application interface.
CrossSection⁡x2+y2+z2=4,x+y=1.1,0.1,x=−2..2,y=−2..2,z=−2..2,showfunction=false,title=Sphere
CrossSection⁡x2+y2,z=0..24,x=−4..4,y=−4..4,z=0..25,planes=10,output=animation
Directional Derivatives and the Gradient
The DirectionalDerivative, DirectionalDerivativeTutor, Gradient, and GradientTutor routines of the MultivariateCalculus package are designed to demonstrate and determine directional derivatives and gradients. The tutor routines provide an interface to the DirectionalDerivative and Gradient routines.
DirectionalDerivativeTutor⁡
DirectionalDerivativeTutor⁡x2+3⁢y12,x,y=1,2,2,3
GradientTutor⁡
GradientTutor⁡y⁢x2+y2,x,y=1,2,3,5
The DirectionalDerivative routine allows you to plot, animate, or obtain the value of the directional derivative, without using the Maplet application interface. The Gradient routine allows you to obtain the gradient, or plot the gradient at a point. Using the output=gradplot option, the Gradient routine can simultaneously plot the gradients at multiple points within a region.
DirectionalDerivative⁡x2+y2,x,y=1,2,3,4
225
DirectionalDerivative⁡x2+3⁢y12,x,y=1,1,1,−1,output=animation,frames=15
Gradientx2+y2, x,y=0,1;
02
Gradientx2+y2, x,y=0,1,2,1, output=plot;
Gradientx2+y2, x,y = 0,1,2,1, output = gradplot;
The Hessian and the Second Derivative Test
The SecondDerivativeTest routine of the MultivariateCalculus package can be used to calculate the Hessian for use in the second derivative test, or to apply the second derivative test to determine the local minima, local maxima, and saddle points.
SecondDerivativeTest⁡x2+y2,x,y=0,0,output=hessian
2002
SecondDerivativeTest⁡x2−y2,x,y=0,0
LocalMin=,LocalMax=,Saddle=0,0
SecondDerivativeTest⁡x2+y2+z2,x,y,z=1,2,1,2,3,1,0,0,0,output=hessian
200020002,200020002,200020002
SecondDerivativeTest⁡x2+y2+z2,x,y,z=1,2,1,2,3,1,0,0,0
LocalMin=0,0,0,LocalMax=,Saddle=
Integrals in Multivariate Calculus
The MultiInt routine of the MultivariateCalculus provides an interface for the construction or evaluation of multiple integrals.
MultiInt⁡x2⁢y,y=x−1..x+1,x=0..4,output=integral
∫04∫x−1x+1x2⁢yⅆyⅆx
MultiInt⁡x2⁢y,y=x−1..x+1,x=0..4
128
MultiInt⁡x2+y2+z,z=−2..4+y2,y=x−1..x+6,x=2..4,output=integral
∫24∫x−1x+6∫−24+y2x2+y2+zⅆzⅆyⅆx
MultiInt⁡x2+y2+z,z=−2..4+y2,y=x−1..x+6,x=2..4
213375445
Integral Approximations
Multivariate integral approximations using Riemann sums can be observed using the ApproximateInt and ApproximateIntTutor routines. The ApproximateIntTutor routine provides a Maplet application interface to the ApproximateInt routine.
ApproximateIntTutor⁡
ApproximateIntTutor⁡x3−y2+x⁢y,y=−4..4
ApproximateIntTutor⁡r,r=0..2,θ=0..π2,coordinates=polar
The ApproximateInt routine allows you to plot, animate, or obtain the value of an integral approximation, without using the Maplet application interface.
ApproximateInt⁡r,r=0..5,t=0..π2,coordinates=polar,output=plot,showfunction=false,prismoptions=color=green,method=upper
ApproximateInt⁡x2+y2,x=−4..4,y=−6..6,output=animation,partition=6,6,frames=2..7
ApproximateInt⁡x2+y2,x=−4..4,y=−6..6,output=value,partition=6,6
1617.777776
The Jacobian
The Jacobian of a list of multivariate functions can be calculated using the Jacobian routine of the MultivariateCalculus package. The Jacobian routine can also be used to calculate the determinant of the Jacobian. The Jacobian is used in the application of a change of variables to a multiple integral. Change of variables is explained in the following section.
Jacobian⁡z⁢x−4⁢y⁢z,x+y−2⁢z,z3,x,y,z=2,1,C
C−4⁢C−211−2003⁢C2
Jacobian⁡z⁢x−4⁢y⁢z,x+y−2⁢z,z3,x,y,z=2,1,C,output=determinant
15⁢C3
Change of Variables
The ChangeOfVariables and Revert commands can be used to rewrite integrals in a more convenient form, and to revert to the original form if the change was not successful, for example, if the endpoints of integration cannot be determined in terms of the new variables.
a:=∫02∫04x2⁢yⅆxⅆy
b:=ChangeOfVariables⁡a,cartesianx,y,polarr,θ
b:=∫y=0y=2∫x=0x=4r4⁢cos⁡θ2⁢sin⁡θⅆrⅆθ
c:=Revert⁡b
c:=∫02∫04x2⁢yⅆxⅆy
The ChangeOfVariables routine can also be applied to triple integrals.
a:=∫∫∫x⁢yzⅆxⅆyⅆz
ChangeOfVariables⁡a,cartesianx,y,z,cylindricalr,θ,u
∫∫∫r3⁢cos⁡θ⁢sin⁡θuⅆrⅆθⅆu
Lagrange Multipliers
The LagrangeMultipliers command calculates or plots the local minima, local maxima, and saddle points of a function subject to constraints, using the method of Lagrange multipliers.
LagrangeMultipliers⁡x⁢y,x28+y22−1,x,y
2,1,−2,−1,−2,1,2,−1
LagrangeMultipliers⁡x⁢y,x28+y22−1,x,y,output=plot
LagrangeMultipliers⁡x⁢y,x28+y22−1,x,y,output=plot,showlevelcurves=false
Lines and Planes
The MultivariateCalculus package supports computations with lines and planes in two and three dimensions, using commands and using the context menu. This functionality will be demonstrated using some problems with answers.
Skew lines
Problem
a) Show that the lines R=A+t P and R=B+s Q, where A, B, P, and Q are defined by
x=3−2 t,y=2+5 t,z=6+t and x=5+4 s,y=7+2 s,z=3+2 s
do not intersect and are not parallel (so they are skew lines);
b) Find the common normal between them.
c) Find the distance between them.
Solution using the context menu
Part a)
Form a list of parametric equations for each line, then select Context Menu: Calculus-Multivariate≻Line≻t (then s for the second line).
x=3−2 t,y=2+5 t,z=6+t→make line<< Line 1 >>→assign to a nameL1
x=5+4 s,y=7+2 s,z=3+2 s→make line<< Line 2 >>→assign to a nameL2
Form a sequence of the line names, select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Skew (or Parallel or Intersect).
L1,L2 = << Line 1 >>,<< Line 2 >>→skew lines?true
L1,L2 = << Line 1 >>,<< Line 2 >>→parallel?false
L1,L2 = << Line 1 >>,<< Line 2 >>→intersect?false
Part b)
Form a plane parallel to both lines (it will contain the first line). Do this by forming a sequence of the line names, then selecting Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Plane.
L1,L2 = << Line 1 >>,<< Line 2 >>→make plane<< Plane 1 >>→assign to a nameP1
Now take the normal of this plane: select Context Menu: Calculus-Multivariate≻Normal.
P1 = << Plane 1 >>→normal88−24
Part c)
Form a sequence of the line names, then select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Distance.
L1, L2 = << Line 1 >>,<< Line 2 >>→distance1611⁢11
Solution using commands
Define the line objects.
L1 ≔ Linex=3−2 t,y=2+5 t,z=6+t;
L1:=<< Line 3 >>
L2 ≔ Linex=5+4 s,y=7+2 s,z=3+2 s;
L2:=<< Line 4 >>
Test skewness with the command AreSkew (or AreParallel or Intersects).
AreSkewL1, L2;
true
AreParallelL1, L2;
false
IntersectsL1, L2;
Form a plane parallel to both lines (it will contain the first line).
P1 ≔ PlaneL1, L2;
P1:=<< Plane 2 >>
Take the normal of this plane with the command GetNormal.
GetNormalP1;
88−24
We can create a plot of these three objects as follows:
plotsdisplayGetPlotP1, GetPlotL1, vectoroptions=width=0.5, GetPlotL2, vectoroptions=width=0.5, caption = typesetThe plane