Student[MultivariateCalculus] Examples - Maple Help

Home : Support : Online Help : Applications and Example Worksheets : Calculus : Student[MultivariateCalculus] Examples

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

$\mathrm{with}(\mathrm{Student}:-\mathrm{MultivariateCalculus}):$



Example 1: Equation of a Plane



 Obtain the equation of the plane containing the three points $\left(1,2,3\right)$, $\left(-1,3,1\right)$, $\left(2,1,-1\right)$.



 • 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

$\left[1,2,3\right],\left[-1,3,1\right],\left[2,1,-1\right]$$\stackrel{\text{make plane}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}\left(\left[\begin{array}{r}-6\\ -10\\ 1\end{array}\right]{,}\left[{1}{,}{2}{,}{3}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{1}\right)$$\stackrel{\text{representation}}{\to }$${-}{6}{x}{-}{10}{y}{+}{z}{=}{-23}$



Example 2: Skew Lines



 Show that  and  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≻$\mathrm{L1}$ (or $\mathrm{L2}$, as appropriate)

$\stackrel{\text{make line}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}\left(\left[{1}{,}{2}{,}{3}\right]{,}\left[\begin{array}{r}2\\ -3\\ 5\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{1}\right)$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{L1}}$

$\stackrel{\text{make line}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}\left(\left[{3}{,}{8}{,}{7}\right]{,}\left[\begin{array}{r}-1\\ 0\\ 6\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{s}{,}{\mathrm{id}}{=}{2}\right)$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{L2}}$

Verify the lines are skew

 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Skew (or Parallel or Intersects)

 $\mathrm{L1},\mathrm{L2}$$\stackrel{\text{skew lines?}}{\to }$${\mathrm{true}}$ $\mathrm{L1},\mathrm{L2}$$\stackrel{\text{parallel?}}{\to }$${\mathrm{false}}$ $\mathrm{L1},\mathrm{L2}$$\stackrel{\text{intersect?}}{\to }$${\mathrm{false}}$

Obtain the distance between the lines

 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Distance
 • Context Panel: Approximate≻10 (digits)

$\mathrm{L1},\mathrm{L2}$$\stackrel{\text{distance}}{\to }$$\frac{{75}\sqrt{{622}}}{{311}}$$\stackrel{\text{at 10 digits}}{\to }$${6.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)

 $\mathrm{L1}$$\stackrel{\text{direction}}{\to }$$\left[\begin{array}{r}2\\ -3\\ 5\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{V1}}$ $\mathrm{L2}$$\stackrel{\text{direction}}{\to }$$\left[\begin{array}{r}-1\\ 0\\ 6\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{V2}}$

 • Common-Symbols palette: Cross-product operator
 • Context Panel: Evaluate and Display Inline
 • Context Panel: Assign to a Name≻N

$\mathbf{V1}×\mathbf{V2}$ = $\left[\begin{array}{r}-18\\ -17\\ -3\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${N}$

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)

$\mathrm{L1}$$\stackrel{\text{point}}{\to }$$\left[{1}{,}{2}{,}{3}\right]$$\stackrel{\text{to Vector}}{\to }$$\left[\begin{array}{r}1\\ 2\\ 3\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{P1}}$

$\mathrm{L2}$$\stackrel{\text{point}}{\to }$$\left[{3}{,}{8}{,}{7}\right]$$\stackrel{\text{to Vector}}{\to }$$\left[\begin{array}{r}3\\ 8\\ 7\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{P2}}$

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Assign to a Name≻V

$\mathbf{P2}-\mathbf{P1}$ = $\left[\begin{array}{r}2\\ 6\\ 4\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${V}$

Project V onto N and obtain the length of this projection

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Projection
 • Context Panel: Student Multivariate Calculus≻Norm
 • Context Panel: Approximate≻10 (digits)

$\mathbf{V},\mathbf{N}$ = $\left[\begin{array}{c}{2}\\ {6}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{-18}\\ {-17}\\ {-3}\end{array}\right]$$\stackrel{\text{projection}}{\to }$$\left[\begin{array}{c}\frac{1350}{311}\\ \frac{1275}{311}\\ \frac{225}{311}\end{array}\right]$$\stackrel{\text{norm}}{\to }$$\frac{{75}\sqrt{{622}}}{{311}}$$\stackrel{\text{at 10 digits}}{\to }$${6.014452050}$



Example 3: Distance from a Point to a Plane



 Determine the distance between the point $\left(1,2,3\right)$ 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

$\stackrel{\text{make plane}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}\left(\left[\begin{array}{r}3\\ -7\\ 5\end{array}\right]{,}\left[\frac{{36}}{{83}}{,}{-}\frac{{84}}{{83}}{,}\frac{{60}}{{83}}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{2}\right)$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{\sigma }}$

Obtain the distance from the point to the plane

 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Distance
 • Context Panel: Approximate≻10 (digits)

$\left[1,2,3\right],\mathrm{σ}$$\stackrel{\text{distance}}{\to }$$\frac{{8}\sqrt{{83}}}{{83}}$$\stackrel{\text{at 10 digits}}{\to }$${0.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: Student Multivariate Calculus≻Lines & Planes≻Point
 • Context Panel: Conversions≻Column Vector
 • Context Panel: Assign to a Name≻P

$\mathrm{σ}$$\stackrel{\text{point}}{\to }$$\left[\frac{{36}}{{83}}{,}{-}\frac{{84}}{{83}}{,}\frac{{60}}{{83}}\right]$$\stackrel{\text{to Vector}}{\to }$$\left[\begin{array}{c}\frac{36}{83}\\ -\frac{84}{83}\\ \frac{60}{83}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${P}$

Obtain V, a vector from the given point to P

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Assign to a Name≻V

$\mathbf{P}-⟨1,2,3⟩$ = $\left[\begin{array}{c}-\frac{47}{83}\\ -\frac{250}{83}\\ -\frac{189}{83}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${V}$

Obtain N, a normal to the plane $\mathrm{σ}$

 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Normal
 • Context Panel: Assign to a Name≻N

$\mathrm{σ}$$\stackrel{\text{normal}}{\to }$$\left[\begin{array}{r}3\\ -7\\ 5\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${N}$

Project V onto N and obtain the length of the projection

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Projection
 • Context Panel: Student Multivariate Calculus≻Norm
 • Context Panel: Approximate≻10 (digits)

$\mathbf{V},\mathbf{N}$ = $\left[\begin{array}{c}{-}\frac{{47}}{{83}}\\ {-}\frac{{250}}{{83}}\\ {-}\frac{{189}}{{83}}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {-7}\\ {5}\end{array}\right]$$\stackrel{\text{projection}}{\to }$$\left[\begin{array}{c}\frac{24}{83}\\ -\frac{56}{83}\\ \frac{40}{83}\end{array}\right]$$\stackrel{\text{norm}}{\to }$$\frac{{8}\sqrt{{83}}}{{83}}$$\stackrel{\text{at 10 digits}}{\to }$${0.8781140799}$



Example 4: Vector Projection onto a Plane



 Obtain the vector projection of  onto the plane spanned by the vectors  and .



Define the vectors A, B, C

 • Context Panel: Assign Name

 $\mathbf{A}=⟨3,5,-7⟩$$\stackrel{\text{assign}}{\to }$ $\mathbf{B}=⟨4,-1,9⟩$$\stackrel{\text{assign}}{\to }$ $\mathbf{C}=⟨2,-3,5⟩$$\stackrel{\text{assign}}{\to }$

Obtain N, the normal to the plane spanned by A and B

 • Common-symbols palette: Cross-product operator
 • Context Panel: Evaluate and Display Inline
 • Context Panel: Assign to a Name≻N

$\mathbf{A}×\mathbf{B}$ = $\left[\begin{array}{r}38\\ -55\\ -23\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${N}$

Obtain the component of C that is along N

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Lines & Planes≻Projection
 • Context Panel: Assign to a Name≻CN

$\mathbf{C},\mathbf{N}$ = $\left[\begin{array}{c}{2}\\ {-3}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{38}\\ {-55}\\ {-23}\end{array}\right]$$\stackrel{\text{projection}}{\to }$$\left[\begin{array}{c}\frac{114}{119}\\ -\frac{165}{119}\\ -\frac{69}{119}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{CN}}$

Obtain the component of C that is orthogonal to N

 • Context Panel: Evaluate and Display Inline

$\mathbf{C}-\mathbf{CN}$ = $\left[\begin{array}{c}\frac{124}{119}\\ -\frac{192}{119}\\ \frac{664}{119}\end{array}\right]$



Contours and Plane Sections



Initialization

 • Tools≻Load Package: Student Multivariate Calculus

$\mathrm{with}(\mathrm{Student}:-\mathrm{MultivariateCalculus}):$



Example 1: Contour Map



 Obtain a contour map of the function .



 • Control-drag the rule for the function.
 • Context Panel: Plot Builder
 • Select 2-D contour plot

$\to$



Example 2: Plane Sections



 For , obtain graphs of the plane sections $x=\mathrm{constant}$ and $y=\mathrm{constant}$.



 • Invoke the  tutor, or...
 • 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



Initialization

 • Tools≻Load Package: Student Multivariate Calculus

$\mathrm{with}(\mathrm{Student}:-\mathrm{MultivariateCalculus}):$



Example 1: Differentiate a Vector



 To the vector , apply componentwise differentiation with respect to $x$.



Method 1: Differentiation from Context Panel

 • Context Panel: Differentiate≻With Respect To≻$x$

$⟨x,{x}^{2}⟩$$\stackrel{\text{differentiate w.r.t. x}}{\to }$$\left[\begin{array}{c}1\\ 2x\end{array}\right]$

Method 2: Differentiation operator from Calculus palette

 • Calculus palette: Differentiation operator
 • Context Panel: Evaluate and Display Inline

= $\left[\begin{array}{c}1\\ 2x\end{array}\right]$

Method 3: Use functional notation

 • Context Panel: Assign Function

$\mathbf{R}\left(x\right)=⟨x,{x}^{2}⟩$$\stackrel{\text{assign as function}}{\to }$${R}$

 • Apply prime as apostrophe (') or as (#) from the Punctuation palette.
 • Context Panel: Evaluate and Display Inline

$\mathbf{R}\prime \left(x\right)$ = $\left[\begin{array}{c}1\\ 2x\end{array}\right]$



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: $\mathbf{R}\prime \left(2\right)$.



If the vector is a function of $t$, then use the overdot notation:

 • Context Panel: Assign Function

$\mathbf{Q}\left(t\right)=⟨t,{t}^{2}⟩$$\stackrel{\text{assign as function}}{\to }$${Q}$

 • Apply the overdot. Context Panel: Evaluate and Display Inline

$\stackrel{.}{\mathbf{Q}}\left(t\right)$ = $\left[\begin{array}{c}1\\ 2t\end{array}\right]$



The overdot can be implemented via the template $\stackrel{{b}}{{A}}$ 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.





 At the point $\left(2,1\right)$, obtain the gradient of .



 • 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

$\stackrel{\text{gradient}}{\to }$$\left[\left[\begin{array}{r}4\\ 4\end{array}\right]\right]$$\stackrel{\text{select entry 1}}{\to }$$\left[\begin{array}{r}4\\ 4\end{array}\right]$



Example 3: Directional Derivative



 At the point $\left(2,3\right)$, and in the direction of , obtain the directional derivative of .



 • Context Panel: Student Multivariate Calculus≻Differentiate≻Directional Derivative Fill in the "Variables, Point, and Vector" dialog as per the figure to the lower-left.

$\stackrel{\text{directional derivative}}{\to }$${-}\frac{{5}\sqrt{{17}}}{{17}}$



The Context Panel also supports the solution given by $\left(\nabla f\right)\left(P\right)·\mathbf{u}$.

Obtain , the gradient of f evaluated at P:$\left(2,3\right)$

 • 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

$\stackrel{\text{gradient}}{\to }$$\left[\left[\begin{array}{r}3\\ 2\end{array}\right]\right]$$\stackrel{\text{select entry 1}}{\to }$$\left[\begin{array}{r}3\\ 2\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{Gf}}$

Obtain u, a unit vector in the direction of v

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Normalize
 • Context Panel: Assign to a Name≻u

$⟨1,-4⟩$ = $\left[\begin{array}{r}1\\ -4\end{array}\right]$$\stackrel{\text{normalize}}{\to }$$\left[\begin{array}{c}\frac{1}{17}\sqrt{17}\\ -\frac{4}{17}\sqrt{17}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${u}$

Implement the calculation $\left(\nabla f\right)\left(P\right)·\mathbf{u}$

 • Common-Symbols palette: Dot-product operator
 • Context Panel: Evaluate and Display Inline

$\mathrm{Gf}·u$

$\mathbf{Gf}\mathbf{·}\mathbf{u}$ = ${-}\frac{{5}\sqrt{{17}}}{{17}}$



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

$\left[2,3\right],\mathbf{u}$$\stackrel{\text{make line}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}\left(\left[{2}{,}{3}\right]{,}\left[\begin{array}{c}\frac{1}{17}\sqrt{17}\\ -\frac{4}{17}\sqrt{17}\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{6}\right)$$\stackrel{\text{representation}}{\to }$$\left[{x}{=}{2}{+}\frac{{t}\sqrt{{17}}}{{17}}{,}{y}{=}{3}{-}\frac{{4}{t}\sqrt{{17}}}{{17}}\right]$$\stackrel{\text{assign to a name}}{\to }$${S}$

Evaluate $f$ along line $S$, differentiate, and take the limit as $t\to 0$

 • Expression palette: Evaluation template
 • Context Panel: Differentiate≻With Respect To≻$t$
 • Context Panel: Simplify≻Simplify
 • Context Panel: Limit (See dialog to the right.)



$\left({2}{+}\frac{{t}\sqrt{{17}}}{{17}}\right)\left({3}{-}\frac{{4}{t}\sqrt{{17}}}{{17}}\right)$

$\stackrel{\text{differentiate w.r.t. t}}{\to }$

$\frac{\sqrt{{17}}\left({3}{-}\frac{{4}{t}\sqrt{{17}}}{{17}}\right)}{{17}}{-}\frac{{4}\left({2}{+}\frac{{t}\sqrt{{17}}}{{17}}\right)\sqrt{{17}}}{{17}}$

$\stackrel{\text{simplify}}{=}$

${-}\frac{{5}\sqrt{{17}}}{{17}}{-}\frac{{8}{t}}{{17}}$

$\stackrel{\text{limit}}{\to }$

${-}\frac{{5}\sqrt{{17}}}{{17}}$



Example 4: Taylor Approximation



 At the point $\left(1,1,f\left(1,1\right)\right)$, obtain the second-degree Taylor polynomial approximation to $f\left(x,y\right)=\frac{x+y}{2+{x}^{2}+{y}^{2}}$.



Solution via the Series option in the Context Panel

 • Control-drag the rule for the function $f$.
 • Context Panel: Series≻Multivariate Taylor Polynomial Complete the "Taylor Polynomial" dialog as per the figure to the right. Click OK.

$\frac{x+y}{2+{x}^{2}+{y}^{2}}$$\stackrel{\text{Taylor polynomial}}{\to }$$\frac{{1}}{{2}}{-}\frac{{\left({x}{-}{1}\right)}^{{2}}}{{8}}{-}\frac{{\left({y}{-}{1}\right)}^{{2}}}{{8}}$



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.

 • Control-drag the rule for the function $f$.
 • 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



Initialization

 • Tools≻Load Package: Student Multivariate Calculus

$\mathrm{with}(\mathrm{Student}:-\mathrm{MultivariateCalculus}):$



Example 1: Unconstrained Optimization



 Find the critical points for .



Initialize

 • Context Panel: Assign to a Name≻$f$

$\stackrel{\text{assign to a name}}{\to }$${f}$

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

 • Context Panel: Assign to a Name≻$S$

$f$

${{x}}^{{2}}{-}{3}{x}{y}{+}{5}{{y}}^{{2}}{-}{4}{x}{+}{7}{y}$

$\stackrel{\text{gradient}}{\to }$

$\left[\begin{array}{c}2x-3y-4\\ -3x+10y+7\end{array}\right]$

$\stackrel{\text{to list}}{\to }$

$\left[{2}{x}{-}{3}{y}{-}{4}{,}{-}{3}{x}{+}{10}{y}{+}{7}\right]$

$\stackrel{\text{solve}}{\to }$

$\left\{{x}{=}\frac{{19}}{{11}}{,}{y}{=}{-}\frac{{2}}{{11}}\right\}$

$\stackrel{\text{assign to a name}}{\to }$

${S}$

Evaluate $f$ at the critical point

${{x}}^{{2}}{-}{3}{x}{y}{+}{5}{{y}}^{{2}}{-}{4}{x}{+}{7}{y}$

 • Expression palette: Evaluation template
 • Context Panel: Evaluate and Display Inline

$\genfrac{}{}{0}{}{f}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{S}$ = ${-}\frac{{45}}{{11}}$

Second-Derivative Test

 • Calculus palette: Partial-differentiation operators
 • Context Panel: Evaluate and Display Inline

 = ${2}$ = ${10}$ = ${-3}$

 • Context Panel: Evaluate and Display Inline

$\left(2\right)\cdot \left(10\right)-{\left(-3\right)}^{2}$ = ${11}$



The test number  is positive, as is ${f}_{\mathrm{xx}}^{2}=2$, so  is a minimum.



Example 2: Lagrange Multiplier Method



 Obtain the extrema for the function  constrained by $g\left(x,y\right)\equiv {x}^{2}+{y}^{2}-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}$ (4.2.1)

 • 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.



$\stackrel{\text{Lagrange multipliers}}{\to }$$\left[{1}{,}{1}\right]{,}\left[{1}{,}{-1}\right]{,}\left[{-1}{,}{1}\right]{,}\left[{-1}{,}{-1}\right]$

 • Select "detailed" for the Output.

$\stackrel{\text{Lagrange multipliers}}{\to }$$\left[{x}{=}{1}{,}{y}{=}{1}{,}{{\mathrm{\lambda }}}_{{1}}{=}\frac{{1}}{{2}}{,}{x}{y}{=}{1}\right]{,}\left[{x}{=}{1}{,}{y}{=}{-1}{,}{{\mathrm{\lambda }}}_{{1}}{=}{-}\frac{{1}}{{2}}{,}{x}{y}{=}{-1}\right]{,}\left[{x}{=}{-1}{,}{y}{=}{1}{,}{{\mathrm{\lambda }}}_{{1}}{=}{-}\frac{{1}}{{2}}{,}{x}{y}{=}{-1}\right]{,}\left[{x}{=}{-1}{,}{y}{=}{-1}{,}{{\mathrm{\lambda }}}_{{1}}{=}\frac{{1}}{{2}}{,}{x}{y}{=}{1}\right]$

 • Select "plot" for the Output.

$\stackrel{\text{Lagrange multipliers}}{\to }$



The Lagrange multiplier method for solving a constrained optimization problem can be solved from first principles as shown below.

Initialize

 • Context Panel: Assign to a Name≻$F$

$\stackrel{\text{assign to a name}}{\to }$${F}$

Form and solve the three equations ${F}_{x}=0,{F}_{y}=0,{F}_{\mathrm{λ}}\equiv g=0$

 • Write $F$ and press the Enter key.
 • Context Panel: Student Multivariate Calculus≻Differentiate≻Gradient
 • Context Panel: Conversions≻To List
 • Context  Panel: Solve≻Solve
 • Context Panel: Assign to a Name≻$S$

$F$

${x}{y}{+}{\mathrm{\lambda }}\left({{x}}^{{2}}{+}{{y}}^{{2}}{-}{2}\right)$

$\stackrel{\text{gradient}}{\to }$

$\left[\begin{array}{c}{x}^{2}+{y}^{2}-2\\ 2\mathrm{λ}x+y\\ 2\mathrm{λ}y+x\end{array}\right]$

$\stackrel{\text{to list}}{\to }$

$\left[{{x}}^{{2}}{+}{{y}}^{{2}}{-}{2}{,}{2}{\mathrm{\lambda }}{x}{+}{y}{,}{2}{\mathrm{\lambda }}{y}{+}{x}\right]$

$\stackrel{\text{solve}}{\to }$

$\left\{{\mathrm{\lambda }}{=}{-}\frac{{1}}{{2}}{,}{x}{=}{1}{,}{y}{=}{1}\right\}{,}\left\{{\mathrm{\lambda }}{=}\frac{{1}}{{2}}{,}{x}{=}{1}{,}{y}{=}{-1}\right\}{,}\left\{{\mathrm{\lambda }}{=}\frac{{1}}{{2}}{,}{x}{=}{-1}{,}{y}{=}{1}\right\}{,}\left\{{\mathrm{\lambda }}{=}{-}\frac{{1}}{{2}}{,}{x}{=}{-1}{,}{y}{=}{-1}\right\}$

$\stackrel{\text{assign to a name}}{\to }$

${S}$

Evaluate  at each of the four critical points found.

 • Expression palette: Evaluation template
 • Context Panel: Evaluate and Display Inline

 = ${1}$ = ${-1}$ $\genfrac{}{}{0}{}{\mathrm{xy}}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{{S}_{3}}$ = ${\mathrm{xy}}$ $\genfrac{}{}{0}{}{\mathrm{xy}}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{{S}_{4}}$ = ${\mathrm{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.

$\stackrel{\text{optimization assistant}}{\to }$

 • Find the additional solutions by modifying the start values in the Initial Values pane.



Integration



Initialization

 • Tools≻Load Package: Student Multivariate Calculus

$\mathrm{with}(\mathrm{Student}:-\mathrm{MultivariateCalculus}):$



Example 1: Riemann-Sum Approximation



 Obtain a Riemann-sum approximation to the integral of $f\left(x,y\right)=8-{x}^{2}-{y}^{2}$ if it is taken over the square $1\le x,y\le 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-{x}^{2}-{y}^{2}$ inside the right cylinder whose cross section is bounded by $y=x,y=2-{x}^{2}$, 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
 • Context Panel: Evaluate and Display Inline

= $\frac{{281}}{{70}}$



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



Initialization

 • Tools≻Load Package: Student Multivariate Calculus

$\mathrm{with}(\mathrm{Student}:-\mathrm{MultivariateCalculus}):$



Example 1: Dot Product



 Obtain the dot product of  and .



 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Dot Product

$⟨a,b⟩,⟨\mathrm{α},\mathrm{β}⟩$ = $\left[\begin{array}{c}{a}\\ {b}\end{array}\right]{,}\left[\begin{array}{c}{\mathrm{\alpha }}\\ {\mathrm{\beta }}\end{array}\right]$$\stackrel{\text{dot product}}{\to }$${a}{\mathrm{\alpha }}{+}{b}{\mathrm{\beta }}$

Alternate solution

 • Common-Symbols palette: Dot product operator
 • Context Panel: Evaluate and Display Inline

$⟨a,b⟩·⟨\mathrm{α},\mathrm{β}⟩$ = ${a}{\mathrm{\alpha }}{+}{b}{\mathrm{\beta }}$



Example 2: Cross Product



 Obtain the cross product of  and .



Initialize

 • Context Panel: Assign Name

$\mathbf{A}=⟨2,3,4⟩$$\stackrel{\text{assign}}{\to }$

 • Context Panel: Assign Name

$\mathbf{B}=⟨5,-1,-7⟩$$\stackrel{\text{assign}}{\to }$

Calculate

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Cross Product

$\mathbf{A},\mathbf{B}$ = $\left[\begin{array}{c}{3}\\ {5}\\ {-7}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {-1}\\ {9}\end{array}\right]$$\stackrel{\text{cross product}}{\to }$$\left[\begin{array}{r}38\\ -55\\ -23\end{array}\right]$

Alternate solution

 • Common-Symbols palette: Cross product operator
 • Context Panel: Evaluate and Display Inline

$\mathbf{A}×\mathbf{B}$ = $\left[\begin{array}{r}38\\ -55\\ -23\end{array}\right]$



Example 3: Norm



 Obtain the Euclidean norm of the vector .



Initialize

 • Context Panel: Assign Name

$\mathbf{V}=⟨a,b,c⟩$$\stackrel{\text{assign}}{\to }$

Euclidean norm

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Norm

$\mathbf{V}$ = $\left[\begin{array}{c}-\frac{47}{83}\\ -\frac{250}{83}\\ -\frac{189}{83}\end{array}\right]$$\stackrel{\text{norm}}{\to }$$\frac{{11}\sqrt{{830}}}{{83}}$

Alternate solution

 • Context Panel: Evaluate and Display Inline

$∥\mathbf{V}∥$ = $\frac{{11}\sqrt{{830}}}{{83}}$



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 .



 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Normalize

$⟨a,b,c⟩$ = $\left[\begin{array}{c}a\\ b\\ c\end{array}\right]$$\stackrel{\text{normalize}}{\to }$$\left[\begin{array}{c}\frac{a}{\sqrt{{a}^{2}+{b}^{2}+{c}^{2}}}\\ \frac{b}{\sqrt{{a}^{2}+{b}^{2}+{c}^{2}}}\\ \frac{c}{\sqrt{{a}^{2}+{b}^{2}+{c}^{2}}}\end{array}\right]$



Example 5: Triple Scalar Product



 Compute $\left[\mathbf{ABC}\right]$, the Triple Scalar (or Box) product of the vectors , , and .



 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Multivariate Calculus≻Triple Scalar Product

$⟨2,3,4⟩,⟨5,-1,-7⟩,⟨3,-2,4⟩$ = $\left[\begin{array}{c}{2}\\ {3}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{5}\\ {-1}\\ {-7}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {-2}\\ {4}\end{array}\right]$$\stackrel{\text{scalar triple product}}{\to }$${-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

$\left[⟨2,3,4⟩,⟨5,-1,-7⟩,⟨3,-2,4⟩\right]$ = $\left[\left[\begin{array}{r}2\\ 3\\ 4\end{array}\right]{,}\left[\begin{array}{r}5\\ -1\\ -7\end{array}\right]{,}\left[\begin{array}{r}3\\ -2\\ 4\end{array}\right]\right]$$\stackrel{\text{combine into Matrix}}{\to }$$\left[\begin{array}{rrr}2& 5& 3\\ 3& -1& -2\\ 4& -7& 4\end{array}\right]$$\stackrel{\text{determinant}}{\to }$${-187}$