Overview of the Student Multivariate Calculus Package - Maple Help

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)$

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}}\right)\right)\right)$