Multivariate Calculus for Students - Maple Help

Home : Support : Online Help : System : Information : Updates : Maple 17 : Multivariate Calculus for Students

 Multivariate Calculus for Students

The Student package contains a lot of functionality that is useful in the classroom. For Maple 17, we added several new items of functionality, the most significant of which is maybe the introduction of Line and Plane objects in the MultivariateCalculus subpackage. These are explained in the current page.

The Line and Plane objects are meant for teaching simple high school (affine) geometry in two and three dimensions. The objects can be defined in many different ways; for example, a Line in three-dimensional space can be defined as:

 – containing two points,
 – containing a point and a direction,
 – being the solution of two equations,
 – having a parametric representation,
 – containing a point and being orthogonal to a plane, or
 – being contained in two planes.

Once the objects are constructed, one can find out the distance to other objects, their relative position, or the intersection between multiple objects.

For many applications, the lines and planes that the objects represent will be fully determined. However, Maple supports arbitrary algebraic expressions occurring in the coordinates of the parameters used to define the objects. For example, it can handle the line through the points $\left[2,3,a\right]$ and $\left[1,{a}^{2}+b,3\right]$.

Examples

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

We construct two lines; the first contains the point $\left[1,0,2\right]$ and the direction $⟨2,-2,1⟩$, the second the points $\left[5,-3,1\right]$ and $\left[3,-3,6\right]$. The Line and Plane objects understand lists as points and Vectors as directions.

 > $\mathrm{l1}:=\mathrm{Line}\left(\left[1,0,2\right],⟨2,-2,1⟩\right)$
 ${\mathrm{l1}}{:=}{\mathrm{<< Line 1 >>}}$ (1)
 > $\mathrm{l2}:=\mathrm{Line}\left(\left[5,-3,1\right],\left[3,-3,6\right]\right)$
 ${\mathrm{l2}}{:=}{\mathrm{<< Line 2 >>}}$ (2)

Let us see if $\mathrm{l1}$ intersects $\mathrm{l2}$.

 > $\mathrm{Intersects}\left(\mathrm{l1},\mathrm{l2}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{pt}:=\mathrm{GetIntersection}\left(\mathrm{l1},\mathrm{l2}\right)$
 ${\mathrm{pt}}{:=}\left[{4}{,}{-}{3}{,}\frac{{7}}{{2}}\right]$ (4)

The intersection is a point.

 > $\mathrm{Contains}\left(\mathrm{l1},\mathrm{pt}\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{Contains}\left(\mathrm{l2},\mathrm{pt}\right)$
 ${\mathrm{true}}$ (6)

We can also find $\mathrm{pt}$ by obtaining equations for both lines (there are two for each) and solving them simultaneously. The default coordinate variables are $x$, $y$, and $z$; when constructing a line or plane, you can choose different variables.

 > $\mathrm{eqns1}:=\mathrm{GetRepresentation}\left(\mathrm{l1},'\mathrm{form}=\mathrm{equations}'\right)$
 ${\mathrm{eqns1}}{:=}\left\{{x}{+}{y}{=}{1}{,}{-}\frac{{1}}{{2}}{}{x}{+}{z}{=}\frac{{3}}{{2}}\right\}$ (7)
 > $\mathrm{eqns2}:=\mathrm{GetRepresentation}\left(\mathrm{l2},'\mathrm{form}=\mathrm{equations}'\right)$
 ${\mathrm{eqns2}}{:=}\left\{{y}{=}{-}{3}{,}\frac{{5}}{{2}}{}{x}{+}{z}{=}\frac{{27}}{{2}}\right\}$ (8)
 > $\mathrm{solve}\left(\mathrm{eqns1}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∪\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{eqns2}\right)$
 $\left\{{x}{=}{4}{,}{y}{=}{-}{3}{,}{z}{=}\frac{{7}}{{2}}\right\}$ (9)

We can obtain various other representations of a line with the GetRepresentation command.

 > $\mathrm{GetRepresentation}\left(\mathrm{l1}\right)$
 ${t}{.}\left[\begin{array}{r}{2}\\ {-}{2}\\ {1}\end{array}\right]{+}\left[\begin{array}{r}{1}\\ {0}\\ {2}\end{array}\right]$ (10)
 > $\mathrm{GetRepresentation}\left(\mathrm{l1},'\mathrm{form}=\mathrm{combined_vector}'\right)$
 $\left[\begin{array}{c}{1}{+}{2}{}{t}\\ {-}{2}{}{t}\\ {2}{+}{t}\end{array}\right]$ (11)
 > $\mathrm{GetRepresentation}\left(\mathrm{l1},'\mathrm{form}=\mathrm{parametric}'\right)$
 $\left[{x}{=}{1}{+}{2}{}{t}{,}{y}{=}{-}{2}{}{t}{,}{z}{=}{2}{+}{t}\right]$ (12)
 > $\mathrm{GetRepresentation}\left(\mathrm{l1},'\mathrm{form}=\mathrm{symmetric}'\right)$
 $\frac{{x}}{{2}}{-}\frac{{1}}{{2}}{=}{-}\frac{{y}}{{2}}{=}{z}{-}{2}$ (13)

We construct a third line, parallel to $\mathrm{l1}$.

 > $\mathrm{l3}:=\mathrm{Line}\left(\left[0,0,0\right],\left[2,-2,1\right]\right)$
 ${\mathrm{l3}}{:=}{\mathrm{<< Line 3 >>}}$ (14)
 > $\mathrm{AreParallel}\left(\mathrm{l1},\mathrm{l3}\right)$
 ${\mathrm{true}}$ (15)

What is the relative position of $\mathrm{l3}$ with respect to $\mathrm{l2}$?

 > $\mathrm{AreParallel}\left(\mathrm{l2},\mathrm{l3}\right)$
 ${\mathrm{false}}$ (16)
 > $\mathrm{Intersects}\left(\mathrm{l2},\mathrm{l3}\right)$
 ${\mathrm{false}}$ (17)
 > $\mathrm{AreSkew}\left(\mathrm{l2},\mathrm{l3}\right)$
 ${\mathrm{true}}$ (18)

We can compute the (Euclidean) distance between a pair of lines using the Distance command. Intersecting lines are at distance 0.

 > $\mathrm{Distance}\left(\mathrm{l1},\mathrm{l2}\right)$
 ${0}$ (19)
 > $\mathrm{Distance}\left(\mathrm{l1},\mathrm{l3}\right)$
 $\frac{{1}}{{3}}{}\sqrt{{29}}$ (20)
 > $\mathrm{Distance}\left(\mathrm{l2},\mathrm{l3}\right)$
 $\frac{{9}}{{65}}{}\sqrt{{65}}$ (21)

The GetPlot command shows a visualization of the line.

 > $\mathrm{GetPlot}\left(\mathrm{l1}\right)$

In order to combine visualizations, one can use plots:-display. With all features of the visualizations turned on, it is a little crowded, so we turn some of them off.

 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{seq}\left(\mathrm{GetPlot}\left(\mathrm{line},'\mathrm{showvector}=\mathrm{false}','\mathrm{showpoint}=\mathrm{false}'\right),\mathrm{line}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\left[\mathrm{l1},\mathrm{l2},\mathrm{l3}\right]\right),'\mathrm{caption}'="Three lines"\right)$

Let's consider the plane containing $\mathrm{l1}$ and $\mathrm{l2}$.

 > $\mathrm{p1}:=\mathrm{Plane}\left(\mathrm{l1},\mathrm{l2}\right)$
 ${\mathrm{p1}}{:=}{\mathrm{<< Plane 1 >>}}$ (22)

What is the relative position of $\mathrm{l3}$ and $\mathrm{p1}$?

 > $\mathrm{Intersects}\left(\mathrm{p1},\mathrm{l3}\right)$
 ${\mathrm{false}}$ (23)
 > $\mathrm{AreParallel}\left(\mathrm{p1},\mathrm{l3}\right)$
 ${\mathrm{true}}$ (24)
 > $\mathrm{Distance}\left(\mathrm{p1},\mathrm{l3}\right)$
 $\frac{{9}}{{65}}{}\sqrt{{65}}$ (25)

The distance between $\mathrm{p1}$ and $\mathrm{l3}$ is the same as the distance between $\mathrm{l2}$ and $\mathrm{l3}$.  This is always the case when $\mathrm{l3}$ is parallel to $\mathrm{p1}$, which contains $\mathrm{l2}$, but $\mathrm{l2}$ is not parallel to $\mathrm{l3}$.

Since $\mathrm{l1}$ and $\mathrm{l2}$ intersect, $\mathrm{l2}$ also intersects the plane containing $\mathrm{l1}$ and $\mathrm{l3}$.

 > $\mathrm{p2}:=\mathrm{Plane}\left(\mathrm{l1},\mathrm{l3}\right)$
 ${\mathrm{p2}}{:=}{\mathrm{<< Plane 2 >>}}$ (26)
 > $\mathrm{Intersects}\left(\mathrm{p2},\mathrm{l2}\right)$
 ${\mathrm{true}}$ (27)

Now let us consider a family of lines. We let $\mathrm{l4}$ be a line containing the point $\left[1,2,-2\right]$ and the direction $⟨a,b,1⟩$, for some values $a$ and $b$.

 > $\mathrm{l4}:=\mathrm{Line}\left(\left[1,2,-2\right],⟨a,b,1⟩\right)$
 ${\mathrm{l4}}{:=}{\mathrm{<< Line 4 >>}}$ (28)
 > $\mathrm{Intersects}\left(\mathrm{l4},\mathrm{l2}\right)$
 ${\mathrm{false}}$ (29)
 > $\mathrm{Distance}\left(\mathrm{l4},\mathrm{l2}\right)$
 $\frac{\left|{25}{}{a}{+}{26}{}{b}{+}{10}\right|}{\sqrt{{29}{}{\left|{b}\right|}^{{2}}{+}{\left|{2}{+}{5}{}{a}\right|}^{{2}}}}$ (30)
 > $\mathrm{Distance}\left(\mathrm{l4},\mathrm{l3}\right)$
 $\frac{\left|{2}{}{a}{+}{5}{}{b}{+}{6}\right|}{\sqrt{{\left|{b}{+}{2}\right|}^{{2}}{+}{\left|{-}{2}{+}{a}\right|}^{{2}}{+}{\left|{2}{}{b}{+}{2}{}{a}\right|}^{{2}}}}$ (31)

If we can find values for $a$ and $b$ that make the numerators of both those distances zero, we get a line that intersects both $\mathrm{l2}$ and $\mathrm{l3}$.

 > $\mathrm{solve}\left(\left\{\mathrm{numer}\left(\right)=0,\mathrm{numer}\left(\right)=0\right\}\right)$
 $\left\{{a}{=}\frac{{106}}{{73}}{,}{b}{=}{-}\frac{{130}}{{73}}\right\}$ (32)

We now let $\mathrm{l5}$ be the particular line with these values for $a$ and $b$.

 > $\mathrm{l5}:=\mathrm{eval}\left(\mathrm{l4},\right)$
 ${\mathrm{l5}}{:=}{\mathrm{<< Line 5 >>}}$ (33)
 > $\mathrm{GetRepresentation}\left(\mathrm{l5}\right)$
 ${t}{.}\left[\begin{array}{c}\frac{{106}}{{73}}\\ {-}\frac{{130}}{{73}}\\ {1}\end{array}\right]{+}\left[\begin{array}{r}{1}\\ {2}\\ {-}{2}\end{array}\right]$ (34)
 > $\mathrm{GetIntersection}\left(\mathrm{l2},\mathrm{l5}\right)$
 $\left[\frac{{66}}{{13}}{,}{-}{3}{,}\frac{{21}}{{26}}\right]$ (35)
 > $\mathrm{GetIntersection}\left(\mathrm{l3},\mathrm{l5}\right)$
 $\left[\frac{{57}}{{4}}{,}{-}\frac{{57}}{{4}}{,}\frac{{57}}{{8}}\right]$ (36)

Additional examples can be found in the MultivariateCalculus Example Worksheet.