Student MultivariateCalculus Examples
The Student:-MultivariateCalculus package is designed to aid in the teaching and understanding of multivariate calculus concepts. For a general overview, see MultivariateCalculus. For introductory examples, see MultivariateCalculus Example Worksheet.
Lines and Planes
Initialization
Tools≻Load Package: Student Multivariate Calculus
with(Student:-MultivariateCalculus):
Example 1: Equation of a Plane
Obtain the equation of the plane containing the three points 1,2,3, −1,3,1, 2,1,−1.
Write a sequence of the three points.
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Plane In the "Choose Variables for Plane" dialog, accept default names or provide new ones.
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Representation
1,2,3,−1,3,1,2,1,−1→make plane<< Plane 1 >>→representation−6⁢x−10⁢y+z=−23
Example 2: Skew Lines
Show that x=1+2 t,y=2−3 t,z=3+5 t and x=3−s,y=5+3,z=7+6 s define skew lines, and find the distance between them.
Create Line Objects for each line
Form a list of the parametric equations defining a line.
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Line≻t or s, as appropriate
Context Panel: Assign to a Name≻L1 (or L2, as appropriate)
x=1+2 t,y=2−3 t,z=3+5 t→make line<< Line 1 >>→assign to a nameL1
x=3−s,y=5+3,z=7+6 s→make line<< Line 2 >>→assign to a nameL2
Verify the lines are skew
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Skew (or Parallel or Intersects)
L1,L2→skew lines?true
L1,L2→parallel?false
L1,L2→intersect?false
Obtain the distance between the lines
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Distance
Context Panel: Approximate≻10 (digits)
L1,L2→distance75⁢622311→at 10 digits6.014452050
The standard approach to finding the distance between skew lines is vectorial: Obtain N, the vector orthogonal to both lines, and project V, any vector from one line to the other, onto N. The length of this projection is the distance between the lines.
Obtain N, the common normal
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Direction
Context Panel: Assign to a Name≻V1 (or V2, as applicable)
L1→direction2−35→assign to a nameV1
L2→direction−106→assign to a nameV2
Common-Symbols palette: Cross-product operator
Context Panel: Evaluate and Display Inline
Context Panel: Assign to a Name≻N
V1×V2 = −18−17−3→assign to a nameN
Obtain V, a vector from one line to the other
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Point
Context Panel: Conversions≻Column Vector
Context Panel: Assign to a Name≻P1 (or P2, as appropriate)
L1→point1,2,3→to Vector123→assign to a nameP1
L2→point3,8,7→to Vector387→assign to a nameP2
Context Panel: Assign to a Name≻V
P2−P1 = 264→assign to a nameV
Project V onto N and obtain the length of this projection
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Projection
Context Panel: Student Multivariate Calculus≻Norm
V,N = 264,−18−17−3→projection13503111275311225311→norm75⁢622311→at 10 digits6.014452050
Example 3: Distance from a Point to a Plane
Determine the distance between the point 1,2,3 and the plane defined by the equation .
Define the plane as a Plane Object
Control-drag the equation of the plane.
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Plane
Context Panel: Assign to a Name≻sigma
3 x−7 y+5 z=12→make plane<< Plane 2 >>→assign to a nameσ
Obtain the distance from the point to the plane
1,2,3,σ→distance8⁢8383→at 10 digits0.8781140799
The standard approach to finding the distance from a point to a plane is vectorial: Project V, a vector from the point to the plane, onto N, the normal to the plane. The length of this projection is the distance from the point to the plane.
Obtain P, a point on the plane, and represent it as a position vector P
Context Panel: Assign to a Name≻P
σ→point3683,−8483,6083→to Vector3683−84836083→assign to a nameP
Obtain V, a vector from the given point to P
P−1,2,3 = −4783−25083−18983→assign to a nameV
Obtain N, a normal to the plane σ
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Normal
σ→normal3−75→assign to a nameN
Project V onto N and obtain the length of the projection
V,N = −4783−25083−18983,3−75→projection2483−56834083→norm8⁢8383→at 10 digits0.8781140799
Example 4: Vector Projection onto a Plane
Obtain the vector projection of C=2 i−3 j+5 k onto the plane spanned by the vectors A=3 i+5 j−7 k and B=4 i−j+9 k.
Define the vectors A, B, C
Context Panel: Assign Name
A=3,5,−7→assign
B=4,−1,9→assign
C=2,−3,5→assign
Obtain N, the normal to the plane spanned by A and B
Common-symbols palette: Cross-product operator
A×B = 38−55−23→assign to a nameN
Obtain the component of C that is along N
Context Panel: Assign to a Name≻CN
C,N = 2−35,38−55−23→projection114119−165119−69119→assign to a nameCN
Obtain the component of C that is orthogonal to N
C−CN = 124119−192119664119
Contours and Plane Sections
Example 1: Contour Map
Obtain a contour map of the function fx,y=x2+2 y2.
Control-drag the rule for the function.
Context Panel: Plot Builder
Select 2-D contour plot
x2+2 y2→
Example 2: Plane Sections
For fx,y=3−2 x2−y2, obtain graphs of the plane sections x=constant and y=constant.
Invoke the tutor, or...
Control-drag the rule for the function f. Context Panel: Student Multivariate Calculus≻Tutors≻Cross Sections Adjust, as per the figures below.
Differentiation
Example 1: Differentiate a Vector
To the vector R=x i+x2 j, apply componentwise differentiation with respect to x.
Method 1: Differentiation from Context Panel
Context Panel: Differentiate≻With Respect To≻x
x,x2→differentiate w.r.t. x12⁢x
Method 2: Differentiation operator from Calculus palette
Calculus palette: Differentiation operator
ⅆⅆ x <x,x2> = 12⁢x
Method 3: Use functional notation
Context Panel: Assign Function
Rx=x,x2→assign as functionR
Apply prime as apostrophe (') or as (#) from the Punctuation palette.
R′x = 12⁢x
The advantage of functional notation is that it is then very easy to evaluate the derivative at a specific value of the independent variable, as in: R′2.
If the vector is a function of t, then use the overdot notation:
Qt=t,t2→assign as functionQ
Apply the overdot. Context Panel: Evaluate and Display Inline
Q.t = 12⁢t
The overdot can be implemented via the template Ab from the Layout palette, or from the keyboard by simultaneously pressing the three keys: Control, Shift, Double/Single Quote ( Ctrl + Shift + '). This places the cursor on top of the letter to the left of the cursor. Then, simply use the period for the overdot. Descend from the top of the character with the right-arrow key.
Example 2: Gradient Vector
At the point 2,1, obtain the gradient of fx,y= x2+2 y2.
Control-drag the rule for the function f.
Context Panel: Student Multivariate Calculus≻Differentiation≻Gradient Fill out the "Variables and Point" dialog as per Figure 1.
Context Panel: Select Element≻1
Figure 1
x2+2 y2→gradient44→select entry 144
Example 3: Directional Derivative
At the point 2,3, and in the direction of v=i−4 j, obtain the directional derivative of fx,y=x y.
Context Panel: Student Multivariate Calculus≻Differentiate≻Directional Derivative Fill in the "Variables, Point, and Vector" dialog as per the figure to the lower-left.
x y→directional derivative−5⁢1717
The Context Panel also supports the solution given by ∇fP·u.
Obtain ∇f P, the gradient of f evaluated at P:2,3
Context Panel: Student Multivariate Calculus≻Differentiate≻Gradient Fill in the "Variables and Point" dialog along the lines suggested by Figure 1 in Example 2.
Context Panel: Select element≻1
Context Panel: Assign to a Name≻Gf
x y→gradient32→select entry 132→assign to a nameGf
Obtain u, a unit vector in the direction of v
Context Panel: Student Multivariate Calculus≻Normalize
Context Panel: Assign to a Name≻u
1,−4 = 1−4→normalize1717−4⁢1717→assign to a nameu
Implement the calculation ∇fP·u
Common-Symbols palette: Dot-product operator
Gf·u
Gf·u = −5⁢1717
A solution from first principles: evaluate f along a line through P and direction u, parametrized with t so that P corresponds to t=0. Differentiate with respect to the parameter on the line, and take the limit as this parameter goes to zero.
Obtain the equation of the line through P with direction u
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Line
Context Panel: Student Multivariate Calculus≻Lines & Planes≻ Representation≻parametric (See figure to the right)
Context Panel: Assign to a Name≻S
2,3,u→make line<< Line 6 >>→representationx=2+t⁢1717,y=3−4⁢t⁢1717→assign to a nameS
Evaluate f along line S, differentiate, and take the limit as t→0
Expression palette: Evaluation template
Context Panel: Differentiate≻With Respect To≻t
Context Panel: Simplify≻Simplify
Context Panel: Limit (See dialog to the right.)
x yx=a|f(x)S
2+t⁢1717⁢3−4⁢t⁢1717
→differentiate w.r.t. t
17⁢3−4⁢t⁢171717−4⁢2+t⁢1717⁢1717
= simplify
−5⁢1717−8⁢t17
→limit
−5⁢1717
Example 4: Taylor Approximation
At the point 1,1,f1,1, obtain the second-degree Taylor polynomial approximation to fx,y=x+y2+x2+y2.
Solution via the Series option in the Context Panel
Context Panel: Series≻Multivariate Taylor Polynomial Complete the "Taylor Polynomial" dialog as per the figure to the right. Click OK.
x+y2+x2+y2→Taylor polynomial12−x−128−y−128
The Taylor Approximation tutor will provide the same solution, but in addition, it will draw a graph of the surface defined by f, and show the surface defined by the approximation.
Context Panel: Student Multivariate Calculus≻Tutors≻Taylor Approximation Configure the tutor as per Figure 2.
Figure 2 The surface f is in red; the second-degree approximation is in blue
Optimization
Example 1: Unconstrained Optimization
Find the critical points for fx,y=x2−3 x y+5 y2−4 x+7 y.
Initialize
Context Panel: Assign to a Name≻f
x2−3 x y+5 y2−4 x+7 y→assign to a namef
Obtain critical points
Type f and press the Enter key.
Context Panel: Student Multivariate Calculus≻ Differentiation≻Gradient
Context Panel: Conversions≻To List
Context Panel: Solve≻Solve
f
x2−3⁢x⁢y+5⁢y2−4⁢x+7⁢y
→gradient
2⁢x−3⁢y−4−3⁢x+10⁢y+7
→to list
2⁢x−3⁢y−4,−3⁢x+10⁢y+7
→solve
x=1911,y=−211
→assign to a name
S
Evaluate f at the critical point
fx=a|f(x)S = −4511
Second-Derivative Test
Calculus palette: Partial-differentiation operators
∂2∂x2 f = 2
∂2∂y2 f = 10
∂2∂ y⁢∂ x f = −3
2⋅10−−32 = 11
The test number fxx2 fyy2−fxy2=11 is positive, as is fxx2=2, so f19/11,−2/11= −45/11 is a minimum.
Example 2: Lagrange Multiplier Method
Obtain the extrema for the function fx,y=x y constrained by gx,y≡x2+y2−2=0.
Access the LagrangeMultipliers command through the Context Panel
Write a sequence of the objective function f, and a list of constraint function(s) g. Context Panel: Student Multivariate Calculus≻Lagrange Multipliers Complete the dialog as per the figure, below.
g
The independent variables are entered as a list.
There are three options for the Output: value, detailed, plot. The "detailed" output includes the Lagrange multiplier and the value of the objective function at the critical point.
x y,x2+y2−2→Lagrange multipliers1,1,1,−1,−1,1,−1,−1
Select "detailed" for the Output.
x y,x2+y2−2→Lagrange multipliersx=1,y=1,λ1=12,x⁢y=1,x=1,y=−1,λ1=−12,x⁢y=−1,x=−1,y=1,λ1=−12,x⁢y=−1,x=−1,y=−1,λ1=12,x⁢y=1
Select "plot" for the Output.
x y,x2+y2−2→Lagrange multipliers
The Lagrange multiplier method for solving a constrained optimization problem can be solved from first principles as shown below.
Context Panel: Assign to a Name≻F
x y+λ x2+y2−2→assign to a nameF
Form and solve the three equations Fx=0,Fy=0,Fλ≡g=0
Write F and press the Enter key.
Context Panel: Student Multivariate Calculus≻Differentiate≻Gradient
F
x⁢y+λ⁢x2+y2−2
x2+y2−22⁢λ⁢x+y2⁢λ⁢y+x
x2+y2−2,2⁢λ⁢x+y,2⁢λ⁢y+x
λ=−12,x=1,y=1,λ=12,x=1,y=−1,λ=12,x=−1,y=1,λ=−12,x=−1,y=−1
Evaluate fx,y=x y at each of the four critical points found.
x yx=a|f(x)S1 = 1
x yx=a|f(x)S2 = −1
xyx=a|f(x)S3 = xy
xyx=a|f(x)S4 = xy
The constrained optimization problem can be solved numerically by the Optimization Assistant, accessed from the Context Panel.
Write the sequence of objective function and constraint equation.
Context Panel: Optimization≻Optimization Assistant Press the Edit button to the right of "Initial Values" and change the defaults to x=3,y=3 Select Maximize and press the Solve button to get the solution shown in the left-hand figure. Press the Plot button; adjust the defaults as shown in the right-hand figure. Press the Quit button to obtain the solution calculated by the Assistant.
x y,x2+y2=2→optimization assistant
Find the additional solutions by modifying the start values in the Initial Values pane.
Integration
Example 1: Riemann-Sum Approximation
Obtain a Riemann-sum approximation to the integral of fx,y=8−x2−y2 if it is taken over the square 1≤x,y≤2.
A Riemann-sum approximation to an iterated double integral taken over a rectangular domain can be obtained with the tutor.
The figure at the right shows the state of the tutor after the "Lower-sum" method has been selected and the Display button pressed.
The Animate button will produce an animation in which the partition starts at 3×3 and increases to the partition selected in the tutor.
With the Student MultivariateCalculus package loaded, the tutor can be launched from the Context Panel applied to the rule for f. Select "Approximate Integration" in the Tutors section under the option Student Multivariate Calculus.
Example 2: Volume
Find the volume between the surfaces z=0 and z=5−x2−y2 inside the right cylinder whose cross section is bounded by y=x,y=2−x2, and x=0.
The simplest way to formulate and evaluate the iterated double integral that gives the requisite volume is to use the integration template in the Calculus palette, then select Evaluate and Display Inline in the Context Panel.
Calculus palette: Iterated double-integral template
∫01∫x2−x25−x2−y2 ⅆy ⅆx = 28170
The Context Panel also provides access to the MultiInt command, which has three possible returns: The unevaluated integral, the value of the integral, and a stepwise evaluation of the solution. In the solution below, the "steps" option is selected, the results of which are displayed under the screen-shots of the intermediate dialogs that collect the data needed for the integration.
Context Panel: Student Multivariate Calculus≻Integrate≻Iterated Fill in the "Specify coordinate system" dialog as per the figure on the left, below. Fill in the "Specify parameter ranges and form" dialog as per the figure on the right, below.
General Algebraic Manipulations
Example 1: Dot Product
Obtain the dot product of A=a i+b j and B=α i+β j.
Context Panel: Student Multivariate Calculus≻Dot Product
a,b,α,β = ab,αβ→dot producta⁢α+b⁢β
Alternate solution
Common-Symbols palette: Dot product operator
a,b·α,β = a⁢α+b⁢β
Example 2: Cross Product
Obtain the cross product of A=2 i+3 j+4 k and B=5 i−j−7 k.
A=2,3,4→assign
B=5,−1,−7→assign
Calculate
Context Panel: Student Multivariate Calculus≻Cross Product
A,B = 35−7,4−19→cross product38−55−23
Common-Symbols palette: Cross product operator
A×B = 38−55−23
Example 3: Norm
Obtain the Euclidean norm of the vector V=a i+b j+c k.
V=a,b,c→assign
Euclidean norm
V = −4783−25083−18983→norm11⁢83083
V = 11⁢83083
The notation for a vector norm can be typeset from the keyboard by typing two vertical strokes on either side of the vector. Alternatively, use the double-bar template from, for example, the Common-Symbols palette.
Example 4: Normalize
Normalize (under the Euclidean norm) the vector V=a i+b j+c k.
a,b,c = abc→normalizeaa2+b2+c2ba2+b2+c2ca2+b2+c2
Example 5: Triple Scalar Product
Compute ABC, the Triple Scalar (or Box) product of the vectors A=2 i+3 j+4 k, B=5 i−j−7 k, and C=3 i−2 j+4 k.
Context Panel: Student Multivariate Calculus≻Triple Scalar Product
2,3,4,5,−1,−7,3,−2,4 = 234,5−1−7,3−24→scalar triple product−187
An alternate solution consists in forming the matrix whose row entries are the components of the three vectors, then computing the determinant. However, since the determinant of the transpose is the same as the determinant of the matrix, it suffices to construct a matrix whose column entries are the components of the vectors.
Write a list of the three vectors. Context Panel: Evaluate and Display Inline
Context Panel: Select Elements≻Combine into Matrix
Context Panel: Standard Operations≻Determinant
2,3,4,5,−1,−7,3,−2,4 = 234,5−1−7,3−24→combine into Matrix2533−1−24−74→determinant−187
Return to Index of Example Worksheets
Download Help Document