Overview of the Student Multivariate Calculus Package - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : Applications and Example Worksheets : Calculus : Overview of the Student Multivariate Calculus Package

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.

 > $\mathrm{restart}$
 > $\mathrm{with}\left(\mathrm{Student}:-\mathrm{MultivariateCalculus}\right):$

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.  For additional examples, see the moreStudentMultivariateCalculus example worksheet.

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.

 > $\mathrm{TaylorApproximationTutor}\left(\right)$
 > $\mathrm{TaylorApproximationTutor}\left(\mathrm{sin}\left(x+y\right),\left[x,y\right]=\left[1,2\right],8\right)$

The TaylorApproximation routine allows you to calculate, plot, or animate the Taylor approximation, without using the Maplet application interface.

 > $\mathrm{TaylorApproximation}\left(\mathrm{sin}\left(x+y\right),\left[x,y\right]=\left[1,0\right],5\right)$
 $\frac{{\mathrm{cos}}{}\left({1}\right){{y}}^{{5}}}{{120}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){{y}}^{{4}}}{{24}}{+}\frac{{\mathrm{cos}}{}\left({1}\right)\left({x}{-}{1}\right){{y}}^{{4}}}{{24}}{-}\frac{{\mathrm{cos}}{}\left({1}\right){{y}}^{{3}}}{{6}}{+}\frac{{\mathrm{sin}}{}\left({1}\right)\left({x}{-}{1}\right){{y}}^{{3}}}{{6}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{2}}{{y}}^{{3}}}{{12}}{-}\frac{{\mathrm{sin}}{}\left({1}\right){{y}}^{{2}}}{{2}}{-}\frac{{\mathrm{cos}}{}\left({1}\right)\left({x}{-}{1}\right){{y}}^{{2}}}{{2}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{2}}{{y}}^{{2}}}{{4}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{3}}{{y}}^{{2}}}{{12}}{+}{\mathrm{cos}}{}\left({1}\right){y}{-}{\mathrm{sin}}{}\left({1}\right)\left({x}{-}{1}\right){y}{-}\frac{{\mathrm{cos}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{2}}{y}}{{2}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{3}}{y}}{{6}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{4}}{y}}{{24}}{+}{\mathrm{sin}}{}\left({1}\right){+}{\mathrm{cos}}{}\left({1}\right)\left({x}{-}{1}\right){-}\frac{{\mathrm{sin}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{2}}}{{2}}{-}\frac{{\mathrm{cos}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{3}}}{{6}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{4}}}{{24}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){\left({x}{-}{1}\right)}^{{5}}}{{120}}$ (1.1)

The following creates an animation.  To run any of the animations in this worksheet:

 1 Click the plot. The plot toolbar is displayed.
 2 In the toolbar, click the Play button.
 Alternatively, right-click (Control-click, on Mac) the plot to display the context menu.  Select Animation > Play.
 > $\mathrm{TaylorApproximation}\left(\mathrm{sin}\left(x+y\right),\left[x,y\right]=\left[1,0\right],5,\mathrm{output}=\mathrm{animation}\right)$

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.

 > $\mathrm{CrossSectionTutor}\left(\right)$
 > $\mathrm{CrossSectionTutor}\left({x}^{2}+{y}^{2}+{z}^{2}=4,x+z=\left[2,1,0\right],x=-2..2,y=-2..2,z=-2..2\right)$

The CrossSection routine allows you to plot or animate the cross-sections without using the Maplet application interface.

 > $\mathrm{CrossSection}\left({x}^{2}+{y}^{2}+{z}^{2}=4,x+y=\left[1.1,0.1\right],x=-2..2,y=-2..2,z=-2..2,\mathrm{showfunction}=\mathrm{false},\mathrm{title}="Sphere"\right)$
 > $\mathrm{CrossSection}\left({x}^{2}+{y}^{2},z=0..24,x=-4..4,y=-4..4,z=0..25,\mathrm{planes}=10,\mathrm{output}=\mathrm{animation}\right)$

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.

 > $\mathrm{DirectionalDerivativeTutor}\left(\right)$
 > $\mathrm{DirectionalDerivativeTutor}\left({x}^{2}+3{y}^{\frac{1}{2}},\left[x,y\right]=\left[1,2\right],\left[2,3\right]\right)$
 > $\mathrm{GradientTutor}\left(\right)$
 > $\mathrm{GradientTutor}\left(y{x}^{2}+{y}^{2},\left[x,y\right]=\left[\left[1,2\right],\left[3,5\right]\right]\right)$

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.

 > $\mathrm{DirectionalDerivative}\left({x}^{2}+{y}^{2},\left[x,y\right]=\left[1,2\right],\left[3,4\right]\right)$
 $\frac{{22}}{{5}}$ (3.1)
 > $\mathrm{DirectionalDerivative}\left({x}^{2}+3{y}^{\frac{1}{2}},\left[x,y\right]=\left[1,1\right],\left[1,-1\right],\mathrm{output}=\mathrm{animation},\mathrm{frames}=15\right)$
 >
 $\left[\left[\begin{array}{r}0\\ 2\end{array}\right]\right]$ (3.2)
 >
 >

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.

 > $\mathrm{SecondDerivativeTest}\left({x}^{2}+{y}^{2},\left[x,y\right]=\left[0,0\right],\mathrm{output}=\mathrm{hessian}\right)$
 $\left[\begin{array}{rr}2& 0\\ 0& 2\end{array}\right]$ (4.1)
 > $\mathrm{SecondDerivativeTest}\left({x}^{2}-{y}^{2},\left[x,y\right]=\left[0,0\right]\right)$
 ${\mathrm{LocalMin}}{=}\left[\right]{,}{\mathrm{LocalMax}}{=}\left[\right]{,}{\mathrm{Saddle}}{=}\left[\left[{0}{,}{0}\right]\right]$ (4.2)
 > $\mathrm{SecondDerivativeTest}\left({x}^{2}+{y}^{2}+{z}^{2},\left[x,y,z\right]=\left[\left[1,2,1\right],\left[2,3,1\right],\left[0,0,0\right]\right],\mathrm{output}=\mathrm{hessian}\right)$
 $\left[\begin{array}{ccc}{2}& {0}& {0}\\ {0}& {2}& {0}\\ {0}& {0}& {2}\end{array}\right]{,}\left[\begin{array}{ccc}{2}& {0}& {0}\\ {0}& {2}& {0}\\ {0}& {0}& {2}\end{array}\right]{,}\left[\begin{array}{ccc}{2}& {0}& {0}\\ {0}& {2}& {0}\\ {0}& {0}& {2}\end{array}\right]$ (4.3)
 > $\mathrm{SecondDerivativeTest}\left({x}^{2}+{y}^{2}+{z}^{2},\left[x,y,z\right]=\left[\left[1,2,1\right],\left[2,3,1\right],\left[0,0,0\right]\right]\right)$
 ${\mathrm{LocalMin}}{=}\left[\left[{0}{,}{0}{,}{0}\right]\right]{,}{\mathrm{LocalMax}}{=}\left[\right]{,}{\mathrm{Saddle}}{=}\left[\right]$ (4.4)

Integrals in Multivariate Calculus

The MultiInt routine of the MultivariateCalculus provides an interface for the construction or evaluation of multiple integrals.

 > $\mathrm{MultiInt}\left({x}^{2}y,y=x-1..x+1,x=0..4,\mathrm{output}=\mathrm{integral}\right)$
 ${\mathrm{Int}}{}\left({{x}}^{{2}}{y}{,}\left[{y}{=}{x}{-}{1}{..}{x}{+}{1}{,}{x}{=}{0}{..}{4}\right]\right)$ (5.1)
 > $\mathrm{MultiInt}\left({x}^{2}y,y=x-1..x+1,x=0..4\right)$
 ${128}$ (5.2)
 > $\mathrm{MultiInt}\left({x}^{2}+{y}^{2}+z,z=-2..4+{y}^{2},y=x-1..x+6,x=2..4,\mathrm{output}=\mathrm{integral}\right)$
 ${\mathrm{Int}}{}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{z}{,}\left[{z}{=}{-}{2}{..}{{y}}^{{2}}{+}{4}{,}{y}{=}{x}{-}{1}{..}{x}{+}{6}{,}{x}{=}{2}{..}{4}\right]\right)$ (5.3)
 > $\mathrm{MultiInt}\left({x}^{2}+{y}^{2}+z,z=-2..4+{y}^{2},y=x-1..x+6,x=2..4\right)$
 $\frac{{2133754}}{{45}}$ (5.4)

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.

 > $\mathrm{ApproximateIntTutor}\left(\right)$
 > $\mathrm{ApproximateIntTutor}\left({x}^{3}-{y}^{2}+xy,y=-4..4\right)$
 > $\mathrm{ApproximateIntTutor}\left(r,r=0..2,\mathrm{θ}=0..\frac{\mathrm{π}}{2},\mathrm{coordinates}=\mathrm{polar}\right)$

The ApproximateInt routine allows you to plot, animate, or obtain the value of an integral approximation, without using the Maplet application interface.

 > $\mathrm{ApproximateInt}\left(r,r=0..5,t=0..\frac{\mathrm{π}}{2},\mathrm{coordinates}=\mathrm{polar},\mathrm{output}=\mathrm{plot},\mathrm{showfunction}=\mathrm{false},\mathrm{prismoptions}=\left[\mathrm{color}=\mathrm{green}\right],\mathrm{method}=\mathrm{upper}\right)$
 > $\mathrm{ApproximateInt}\left({x}^{2}+{y}^{2},x=-4..4,y=-6..6,\mathrm{output}=\mathrm{animation},\mathrm{partition}=\left[6,6\right],\mathrm{frames}=2..7\right)$
 > $\mathrm{ApproximateInt}\left({x}^{2}+{y}^{2},x=-4..4,y=-6..6,\mathrm{output}=\mathrm{value},\mathrm{partition}=\left[6,6\right]\right)$
 ${1617.777776}$ (6.1)

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.

 > $\mathrm{Jacobian}\left(\left[zx-4yz,x+y-2z,{z}^{3}\right],\left[x,y,z\right]=\left[2,1,C\right]\right)$
 $\left[\begin{array}{ccc}C& -4C& -2\\ 1& 1& -2\\ 0& 0& 3{C}^{2}\end{array}\right]$ (7.1)
 > $\mathrm{Jacobian}\left(\left[zx-4yz,x+y-2z,{z}^{3}\right],\left[x,y,z\right]=\left[2,1,C\right],\mathrm{output}=\mathrm{determinant}\right)$
 ${15}{{C}}^{{3}}$ (7.2)

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:={{∫}}_{0}^{2}{{∫}}_{0}^{4}{x}^{2}y\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}y$
 ${\mathrm{Int}}{}\left({{x}}^{{2}}{y}{,}\left[{x}{=}{0}{..}{4}{,}{y}{=}{0}{..}{2}\right]\right)$ (8.1)
 > $b:=\mathrm{ChangeOfVariables}\left(a,\left[{\mathrm{cartesian}}_{x,y},{\mathrm{polar}}_{r,\mathrm{θ}}\right]\right)$
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{ChangeOfVariablesObject}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({{r}}^{{4}}{{\mathrm{cos}}{}\left({\mathrm{θ}}\right)}^{{2}}{\mathrm{sin}}{}\left({\mathrm{θ}}\right){,}{r}{=}\left({x}{=}{0}\right){..}\left({x}{=}{4}\right)\right){,}{\mathrm{θ}}{=}\left({y}{=}{0}\right){..}\left({y}{=}{2}\right)\right){,}{s}\right)$ (8.2)
 > $c:=\mathrm{Revert}\left(b\right)$
 ${\mathrm{Int}}{}\left({{x}}^{{2}}{y}{,}\left[{x}{=}{0}{..}{4}{,}{y}{=}{0}{..}{2}\right]\right)$ (8.3)

The ChangeOfVariables routine can also be applied to triple integrals.

 > $a:={∫}{∫}{∫}\frac{xy}{z}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}y\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}z$
 ${\mathrm{Int}}{}\left(\frac{{x}{y}}{{z}}{,}\left[{x}{,}{y}{,}{z}\right]\right)$ (8.4)
 > $\mathrm{ChangeOfVariables}\left(a,\left[{\mathrm{cartesian}}_{x,y,z},{\mathrm{cylindrical}}_{r,\mathrm{θ},u}\right]\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left(\frac{{{r}}^{{3}}{\mathrm{cos}}{}\left({\mathrm{θ}}\right){\mathrm{sin}}{}\left({\mathrm{θ}}\right)}{{u}}{,}{r}\right){,}{\mathrm{θ}}\right){,}{u}\right)$ (8.5)

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.

 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right]\right)$
 $\left[{2}{,}{1}\right]{,}\left[{2}{,}{-1}\right]{,}\left[{-2}{,}{1}\right]{,}\left[{-2}{,}{-1}\right]$ (9.1)
 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right],\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right],\mathrm{output}=\mathrm{plot},\mathrm{showlevelcurves}=\mathrm{false}\right)$

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  and , where A, B, P, and Q are defined by  and       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). $\stackrel{\text{make line}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[{3}{,}{2}{,}{6}\right]{,}\left[\begin{array}{r}-2\\ 5\\ 1\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{1}\right)$$\stackrel{\text{assign to a name}}{\to }$${{L}}_{{1}}$  $\stackrel{\text{make line}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[{5}{,}{7}{,}{3}\right]{,}\left[\begin{array}{r}4\\ 2\\ 2\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{s}{,}{\mathrm{id}}{=}{2}\right)$$\stackrel{\text{assign to a name}}{\to }$${{L}}_{{2}}$   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). ${L}_{1},{L}_{2}$ = ${\mathrm{<< Line 1 >>}}{,}{\mathrm{<< Line 2 >>}}$ = $\stackrel{\text{skew lines?}}{\to }$${\mathrm{true}}$ ${L}_{1},{L}_{2}$ = ${\mathrm{<< Line 1 >>}}{,}{\mathrm{<< Line 2 >>}}$$\stackrel{\text{parallel?}}{\to }$${\mathrm{false}}$ ${L}_{1},{L}_{2}$ = ${\mathrm{<< Line 1 >>}}{,}{\mathrm{<< Line 2 >>}}$$\stackrel{\text{intersect?}}{\to }$${\mathrm{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. ${L}_{1},{L}_{2}$ = ${\mathrm{<< Line 1 >>}}{,}{\mathrm{<< Line 2 >>}}$$\stackrel{\text{make plane}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}8\\ 8\\ -24\end{array}\right]{,}\left[{3}{,}{2}{,}{6}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{1}\right)$$\stackrel{\text{assign to a name}}{\to }$${{P}}_{{1}}$    Now take the normal of this plane: select Context Menu: Calculus-Multivariate≻Normal. ${P}_{1}$ = ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}8\\ 8\\ -24\end{array}\right]{,}\left[{3}{,}{2}{,}{6}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{1}\right)$$\stackrel{\text{normal}}{\to }$$\left[\begin{array}{r}8\\ 8\\ -24\end{array}\right]$   Part c) Form a sequence of the line names, then select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Distance.  = ${\mathrm{<< Line 1 >>}}{,}{\mathrm{<< Line 2 >>}}$$\stackrel{\text{distance}}{\to }$$\frac{{16}\sqrt{{11}}}{{11}}$

Solution using commands

Part a)

Define the line objects.

 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[{3}{,}{2}{,}{6}\right]{,}\left[\begin{array}{r}-2\\ 5\\ 1\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{3}\right)$ (10.1.3.1)
 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[{5}{,}{7}{,}{3}\right]{,}\left[\begin{array}{r}4\\ 2\\ 2\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{s}{,}{\mathrm{id}}{=}{4}\right)$ (10.1.3.2)

Test skewness with the command AreSkew (or AreParallel or Intersects).

 >
 ${\mathrm{true}}$ (10.1.3.3)
 >
 ${\mathrm{false}}$ (10.1.3.4)
 >
 ${\mathrm{false}}$ (10.1.3.5)

Part b)

Form a plane parallel to both lines (it will contain the first line).

 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}8\\ 8\\ -24\end{array}\right]{,}\left[{3}{,}{2}{,}{6}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{2}\right)$ (10.1.3.6)



Take the normal of this plane with the command GetNormal.

 > $\mathrm{GetNormal}\left({P}_{1}\right);$
 $\left[\begin{array}{r}8\\ 8\\ -24\end{array}\right]$ (10.1.3.7)

We can create a plot of these three objects as follows:

 >

Part c)

Use the Distance command.

 >
 $\frac{{16}\sqrt{{11}}}{{11}}$ (10.1.3.8)

Intersection of planes

Problem

 a) Find a formula for the line $\mathrm{ℓ}$ that is the intersection of the planes    and     b) Find an equation for the plane that contains $\mathrm{ℓ}$ and the point P:$\left(2,-3,1\right)$.
 Solution using the context menu Part a) Take the equation of each plane (with copy and paste, control-drag, or by retyping it) and create the planes by selecting Context Menu: Calculus-Multivariate≻Plane, then selecting Context Menu: Assign to a Name≻Q[1] or Q[2]. $\stackrel{\text{make plane}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}3\\ -7\\ -9\end{array}\right]{,}\left[\frac{{24}}{{139}}{,}{-}\frac{{56}}{{139}}{,}{-}\frac{{72}}{{139}}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{3}\right)$$\stackrel{\text{assign to a name}}{\to }$${{Q}}_{{1}}$  $\stackrel{\text{make plane}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}5\\ 4\\ -2\end{array}\right]{,}\left[\frac{{2}}{{3}}{,}\frac{{8}}{{15}}{,}{-}\frac{{4}}{{15}}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{4}\right)$$\stackrel{\text{assign to a name}}{\to }$${{Q}}_{{2}}$    Create the sequence of the two names of planes, select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Intersection, and finally select Context Menu: Assign to a Name≻$L$.  = ${\mathrm{<< Plane 3 >>}}{,}{\mathrm{<< Plane 4 >>}}$$\stackrel{\text{intersection}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{assign to a name}}{\to }$${L}$   To verify that $L$ is indeed contained in the two planes, form a sequence of a plane name and the line name, select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Contains. ${Q}_{1},L$ = ${\mathrm{<< Plane 3 >>}}{,}{\mathrm{<< Line 5 >>}}$$\stackrel{\text{contains?}}{\to }$${\mathrm{true}}$ ${Q}_{2},L$ = ${\mathrm{<< Plane 4 >>}}{,}{\mathrm{<< Line 5 >>}}$$\stackrel{\text{contains?}}{\to }$${\mathrm{true}}$   To get an equation, use the name for the line, select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Representation... . By choosing one of the forms from the drop down menu, one can select from five different representations: $L$ = ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{representation}}{\to }$$\left\{{-}\frac{{47}{x}}{{50}}{+}{z}{=}{-}\frac{{37}}{{25}}{,}\frac{{39}{x}}{{50}}{+}{y}{=}\frac{{19}}{{25}}\right\}$   (here we selected 'equations') $L$ = ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{representation}}{\to }$$\left[{x}{=}\frac{{496}}{{623}}{+}{50}{t}{,}{y}{=}\frac{{433}}{{3115}}{-}{39}{t}{,}{z}{=}{-}\frac{{2279}}{{3115}}{+}{47}{t}\right]$   (here we selected 'parametric') $L$ = ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{representation}}{\to }$${\mathrm{.}}{}\left({t}{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]\right){+}\left(\left[\begin{array}{c}\frac{496}{623}\\ \frac{433}{3115}\\ -\frac{2279}{3115}\end{array}\right]\right)$   (here we selected 'vectors') $L$ = ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{representation}}{\to }$$\left[\begin{array}{c}\frac{496}{623}+50t\\ \frac{433}{3115}-39t\\ -\frac{2279}{3115}+47t\end{array}\right]$   (here we selected 'combined_vector') $L$ = ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{representation}}{\to }$$\frac{{x}}{{50}}{-}\frac{{248}}{{15575}}{=}{-}\frac{{y}}{{39}}{+}\frac{{433}}{{121485}}{=}\frac{{z}}{{47}}{+}\frac{{2279}}{{146405}}$   (here we selected 'symmetric')   Part b) Create the sequence of the line name and the list of coordinates of the point, select Context Menu: Evaluate and Display Inline, then select Context Menu: Calculus-Multivariate≻Plane..., and finally select Context Menu: Assign to a Name≻Q[3].  = ${\mathrm{<< Line 5 >>}}{,}\left[{2}{,}{-3}{,}{1}\right]$$\stackrel{\text{make plane}}{\to }$${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}80\\ -30\\ -110\end{array}\right]{,}\left[{2}{,}{-}{3}{,}{1}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{5}\right)$$\stackrel{\text{assign to a name}}{\to }$${{Q}}_{{3}}$

Solution using commands

Part a)

Create the plane objects.

 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}3\\ -7\\ -9\end{array}\right]{,}\left[\frac{{24}}{{139}}{,}{-}\frac{{56}}{{139}}{,}{-}\frac{{72}}{{139}}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{6}\right)$ (10.2.3.1)
 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}5\\ 4\\ -2\end{array}\right]{,}\left[\frac{{2}}{{3}}{,}\frac{{8}}{{15}}{,}{-}\frac{{4}}{{15}}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{7}\right)$ (10.2.3.2)

Use the GetIntersection command to compute the intersection.

 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Line}}{}\left(\left[\frac{{496}}{{623}}{,}\frac{{433}}{{3115}}{,}{-}\frac{{2279}}{{3115}}\right]{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{parameter}}{=}{t}{,}{\mathrm{id}}{=}{6}\right)$ (10.2.3.3)

Use the GetRepresentation commands to get a formula for $L$. Several forms are available:

 > $\mathrm{GetRepresentation}\left(L\right);$
 ${\mathrm{.}}{}\left({t}{,}\left[\begin{array}{r}50\\ -39\\ 47\end{array}\right]\right){+}\left(\left[\begin{array}{c}\frac{496}{623}\\ \frac{433}{3115}\\ -\frac{2279}{3115}\end{array}\right]\right)$ (10.2.3.4)
 >
 $\left\{{-}\frac{{47}{x}}{{50}}{+}{z}{=}{-}\frac{{37}}{{25}}{,}\frac{{39}{x}}{{50}}{+}{y}{=}\frac{{19}}{{25}}\right\}$ (10.2.3.5)
 >
 $\left[{x}{=}\frac{{496}}{{623}}{+}{50}{t}{,}{y}{=}\frac{{433}}{{3115}}{-}{39}{t}{,}{z}{=}{-}\frac{{2279}}{{3115}}{+}{47}{t}\right]$ (10.2.3.6)
 >
 $\left[\begin{array}{c}\frac{496}{623}+50t\\ \frac{433}{3115}-39t\\ -\frac{2279}{3115}+47t\end{array}\right]$ (10.2.3.7)
 >
 $\frac{{x}}{{50}}{-}\frac{{248}}{{15575}}{=}{-}\frac{{y}}{{39}}{+}\frac{{433}}{{121485}}{=}\frac{{z}}{{47}}{+}\frac{{2279}}{{146405}}$ (10.2.3.8)

Part b)

Create the plane object.

 >
 ${\mathrm{Student}}{:-}{\mathrm{MultivariateCalculus}}{:-}{\mathrm{Plane}}{}\left(\left[\begin{array}{r}80\\ -30\\ -110\end{array}\right]{,}\left[{2}{,}{-}{3}{,}{1}\right]{,}{\mathrm{variables}}{=}\left[{x}{,}{y}{,}{z}\right]{,}{\mathrm{id}}{=}{8}\right)$ (10.2.3.9)

To verify that ${Q}_{3}$ indeed contains both $L$ and the point , use the Contains command.

 >
 ${\mathrm{true}}$ (10.2.3.10)

Applications

The MultivariateCalculus package provides routines to calculate quantities such as function average, surface area, and center of mass, using multivariate calculus.

Function Average

The FunctionAverage command returns the integral used to determine the average of a function over a region or calculates the average of the function over the region.

 > $\mathrm{FunctionAverage}\left({x}^{2}+{y}^{2},x=0..1,y=0..\sqrt{1-{x}^{2}},\mathrm{output}=\mathrm{integral}\right)$
 $\frac{{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({{x}}^{{2}}{+}{{y}}^{{2}}{,}{x}{=}{0}{..}{1}\right){,}{y}{=}{0}{..}\sqrt{{-}{{x}}^{{2}}{+}{1}}\right)}{{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({1}{,}{x}{=}{0}{..}{1}\right){,}{y}{=}{0}{..}\sqrt{{-}{{x}}^{{2}}{+}{1}}\right)}$ (11.1.1)
 > $\mathrm{FunctionAverage}\left({x}^{2}+{y}^{2},x=0..1,y=0..\sqrt{1-{x}^{2}}\right)$
 $\frac{\frac{\sqrt{{-}{{x}}^{{2}}{+}{1}}}{{3}}{+}\frac{{\left({-}{{x}}^{{2}}{+}{1}\right)}^{{3}}{{2}}}}{{3}}}{\sqrt{{-}{{x}}^{{2}}{+}{1}}}$ (11.1.2)
 > $\mathrm{FunctionAverage}\left({r}^{2},r=0..1,t=0..\frac{\mathrm{π}}{2},\mathrm{coordinates}={\mathrm{polar}}_{r,t},\mathrm{output}=\mathrm{integral}\right)$
 $\frac{{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({{r}}^{{3}}{,}{r}{=}{0}{..}{1}\right){,}{t}{=}{0}{..}\frac{{1}}{{2}}{\mathrm{π}}\right)}{{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({r}{,}{r}{=}{0}{..}{1}\right){,}{t}{=}{0}{..}\frac{{1}}{{2}}{\mathrm{π}}\right)}$ (11.1.3)
 > $\mathrm{FunctionAverage}\left({r}^{2},r=0..1,t=0..\frac{\mathrm{π}}{2},\mathrm{coordinates}={\mathrm{polar}}_{r,t}\right)$
 $\frac{{1}}{{2}}$ (11.1.4)
 > $\mathrm{FunctionAverage}\left({x}^{2}+{y}^{2}+z,x=2..4,y=x-1..x+6,z=-2..4+{y}^{2},\mathrm{output}=\mathrm{integral}\right)$
 $\frac{{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{z}{,}{x}{=}{2}{..}{4}\right){,}{y}{=}{x}{-}{1}{..}{x}{+}{6}\right){,}{z}{=}{-}{2}{..}{{y}}^{{2}}{+}{4}\right)}{{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({1}{,}{x}{=}{2}{..}{4}\right){,}{y}{=}{x}{-}{1}{..}{x}{+}{6}\right){,}{z}{=}{-}{2}{..}{{y}}^{{2}}{+}{4}\right)}$ (11.1.5)
 > $\mathrm{FunctionAverage}\left({x}^{2}+{y}^{2}+z,x=2..4,y=x-1..x+6,z=-2..4+{y}^{2}\right)$
 $\frac{\frac{{392}{{y}}^{{2}}}{{3}}{+}{756}{+}\frac{{2}{\left({x}{+}{6}\right)}^{{3}}\left({{y}}^{{2}}{+}{6}\right)}{{3}}{-}\frac{{2}{\left({x}{-}{1}\right)}^{{3}}\left({{y}}^{{2}}{+}{6}\right)}{{3}}{+}{7}{\left({{y}}^{{2}}{+}{4}\right)}^{{2}}}{{14}{{y}}^{{2}}{+}{84}}$ (11.1.6)

Surface Area

The SurfaceArea command plots, constructs the integral for, or calculates the surface area of a curve within a region.

 > $\mathrm{SurfaceArea}\left({x}^{2}+y,x=-2..2,y=-1..1,\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{SurfaceArea}\left({x}^{2}+{y}^{2},x=-2..2,y=-1..1,\mathrm{output}=\mathrm{integral}\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left(\sqrt{{4}{{x}}^{{2}}{+}{4}{{y}}^{{2}}{+}{1}}{,}{y}{=}{-}{1}{..}{1}\right){,}{x}{=}{-}{2}{..}{2}\right)$ (11.2.1)
 > $\mathrm{SurfaceArea}\left({x}^{2}+y,x=-2..2,y=-1..1\right)$
 ${12}\sqrt{{2}}{+}{2}{\mathrm{arcsinh}}{}\left({2}\sqrt{{2}}\right)$ (11.2.2)

Center of Mass

The CenterOfMass command plots, constructs the integral for, or calculates the center of mass of a curve within a region.

 > $\mathrm{CenterOfMass}\left({x}^{2}+{y}^{2},x=1..4,y=-1..6,\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{CenterOfMass}\left({x}^{2}+{y}^{2},x=1..4,y=-1..6,\mathrm{output}=\mathrm{integral}\right)$
 $\frac{{{\int }}_{{-1}}^{{6}}\left({{\int }}_{{1}}^{{4}}{x}\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{y}}{{{\int }}_{{-1}}^{{6}}\left({{\int }}_{{1}}^{{4}}\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{y}}{,}\frac{{{\int }}_{{-1}}^{{6}}\left({{\int }}_{{1}}^{{4}}{y}\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{y}}{{{\int }}_{{-1}}^{{6}}\left({{\int }}_{{1}}^{{4}}\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{y}}$ (11.3.1)
 > $\mathrm{CenterOfMass}\left({x}^{2}+{y}^{2},x=1..4,y=-1..6\right)$
 $\frac{{565}}{{208}}{,}\frac{{765}}{{208}}$ (11.3.2)