 Overview - Maple Help

Overview of Visualization in Calculus1

 • See Student:-Calculus1 for a general introduction to the Calculus1 subpackage of the Student package and a list of visualization routines.
 • The visualization functionality of the Calculus1 package is provided to enable an instructor to demonstrate and a student to understand a range of single-variable calculus concepts both visually and computationally.
 • To use the short forms of the routine names in the Student:-Calculus1 subpackage, enter:
 > with(Student:-Calculus1):
 • The visualization component of Calculus 1 is divided into four categories.

 • Many of the visualization routines can return multiple forms of output, and with the exception of the property routines all can display plots to demonstrate an idea.
 > Roots(x^5-7*x^3-2*x^4+14*x^2+10*x-20);
 $\left[{-}\sqrt{{5}}{,}{-}\sqrt{{2}}{,}\sqrt{{2}}{,}{2}{,}\sqrt{{5}}\right]$ (1)
 > FunctionAverage(sin(x), x=0..10);
 $\frac{{1}}{{10}}{-}\frac{{\mathrm{cos}}\left({10}\right)}{{10}}$ (2)
 > FunctionAverage(sin(x), x=0..10, output=integral);
 $\frac{{1}}{{10}}{}{\mathrm{Int}}\left({\mathrm{sin}}\left({x}\right){,}{x}{=}{0}{..}{10}\right)$ (3)
 > FunctionAverage(sin(x), x=0..10, output=plot); Any integrals which are returned can be used with the Calculus1 single-stepping routines (see Single Step Overview):
 > VolumeOfRevolution(exp(x), x=1..2, output=integral);
 ${\mathrm{Int}}\left({\mathrm{π}}{}{\left({\mathrm{exp}}\left({x}\right)\right)}^{{2}}{,}{x}{=}{1}{..}{2}\right)$ (4)
 > Rule[constantmultiple]((4));
 ${\mathrm{CALCULUS1OBJECT}}\left(\left[{1}{,}\left[{}\right]{,}\left[{}\right]\right]{,}\left\{{x}\right\}\right){=}{\mathrm{π}}{}\left({\mathrm{Int}}\left({\left({\mathrm{exp}}\left({x}\right)\right)}^{{2}}{,}{x}{=}{1}{..}{2}\right)\right)$ (5)
 > Rule[change, u=exp(x)]((5));
 ${\mathrm{CALCULUS1OBJECT}}\left(\left[{1}{,}\left[{4}\right]{,}\left[{}\right]\right]{,}\left\{{x}\right\}\right){=}{\mathrm{π}}{}\left({\mathrm{Int}}\left({u}{,}{u}{=}{\mathrm{exp}}\left({1}\right){..}{\mathrm{exp}}\left({2}\right)\right)\right)$ (6)
 > Rule[power]((6));
 ${{\int }}_{{1}}^{{2}}{\mathrm{\pi }}{}{\left({{ⅇ}}^{{x}}\right)}^{{2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}{=}{\mathrm{\pi }}{}\left(\frac{{\left({{ⅇ}}^{{2}}\right)}^{{2}}}{{2}}{-}\frac{{\left({ⅇ}\right)}^{{2}}}{{2}}\right)$ (7)
 > simplify((7));
 ${{\int }}_{{1}}^{{2}}{\mathrm{\pi }}{}{\left({{ⅇ}}^{{x}}\right)}^{{2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}{=}\frac{{\mathrm{\pi }}{}{{ⅇ}}^{{2}}{}\left({{ⅇ}}^{{2}}{-}{1}\right)}{{2}}$ (8) Properties

 • The routines Roots, Asymptotes, CriticalPoints, ExtremePoints, and InflectionPoints return qualitative information about the given expression.
 Each routine takes, as a second argument, a variable or a variable equated to a range representing the interval in which to search for solutions.  If no range is given, it attempts to return all valid answers.  If there is an infinite number of points of the given type, a warning is given and a few sample points are returned.  If there is only a finite number of points, each routine attempts to return all of them. Roots

 • The Roots routine returns the roots of the given expression.
 > Roots(x^2 - 4*x + 1);
 $\left[{2}{-}\sqrt{{3}}{,}{2}{+}\sqrt{{3}}\right]$ (9)
 > Roots(sin(x), maxsols=3);
 $\left[{-}{\mathrm{\pi }}{,}{0}{,}{\mathrm{\pi }}\right]$ (10)
 > Roots(sin(x), x=10..20);
 $\left[{4}{}{\mathrm{\pi }}{,}{5}{}{\mathrm{\pi }}{,}{6}{}{\mathrm{\pi }}\right]$ (11) Asymptotes

 • The Asymptotes routine returns the horizontal, diagonal, and vertical asymptotes of the expression.
 • By default, horizontal and diagonal asymptotes are returned using the variable $y$, though this can be modified by using extra parameters.
 > Asymptotes((x^2 - 4*x + 1)/x);
 $\left[{y}{=}{x}{-}{4}{,}{x}{=}{0}\right]$ (12)
 > Asymptotes(sin(x)/x);
 $\left[{y}{=}{0}\right]$ (13)
 > Asymptotes(tan(x - 1));
 $\left[{x}{=}{1}{-}\frac{{\mathrm{\pi }}}{{2}}{,}{x}{=}{1}{+}\frac{{\mathrm{\pi }}}{{2}}{,}{x}{=}{1}{+}\frac{{3}{}{\mathrm{\pi }}}{{2}}\right]$ (14)
 > Asymptotes(tan(x - 1), x=20..25);
 $\left[{x}{=}{1}{+}\frac{{13}{}{\mathrm{\pi }}}{{2}}{,}{x}{=}{1}{+}\frac{{15}{}{\mathrm{\pi }}}{{2}}\right]$ (15) Critical Points

 • The CriticalPoints routine returns all points where the derivative is zero or undefined.
 > CriticalPoints((x^4 - 4*x^3 - 4*x)/x);
 $\left[\frac{{8}}{{3}}\right]$ (16)
 > ExtremePoints((x^4 - 4*x^3 - 4*x)/x);
 $\left[\frac{{8}}{{3}}\right]$ (17) Extreme Points

 • The ExtremePoints routine returns all points where the expression attains a local minimum or maximum, including any finite-valued end points on a finite or semi-infinite interval.
 > ExtremePoints((x^4 - 4*x^3 - 4*x)/x);
 $\left[\frac{{8}}{{3}}\right]$ (18)
 > ExtremePoints((x^4 - 4*x^3 - 4*x)/x, x=-3..3);
 $\left[{-3}{,}\frac{{8}}{{3}}{,}{3}\right]$ (19)
 > ExtremePoints(sin(x), x=-10..infinity);
 $\left[{-10}{,}{-}\frac{{5}{}{\mathrm{\pi }}}{{2}}{,}{-}\frac{{3}{}{\mathrm{\pi }}}{{2}}{,}{-}\frac{{\mathrm{\pi }}}{{2}}\right]$ (20) Points of Inflection

 • The InflectionPoints routine returns all points where the sign of the second derivative changes.
 > InflectionPoints((x^3 - 7*x^2 +9*x - 4)/x, -3..7);
 $\left[{{2}}^{{2}}{{3}}}\right]$ (21)
 > InflectionPoints(1/x^2);
 $\left[\right]$ (22)
 > InflectionPoints(csc(x), -10..10);
 $\left[\right]$ (23) Preliminary Routines Shortcomings of Sampling

 • The PointInterpolation routine shows the problems associated with plotting a function based on only sampling the function at a small number of points.  It samples the function at a fixed number of points, and then interpolates those points with a curve.
 > PointInterpolation(sin(x), x=0..14); > PointInterpolation((x^2 - x)/(2*x^2 - 1), x=-4..4);  Newton Quotients

 • Newton quotients approximate the slope of an expression at a point by sampling the expression at nearby points.  For a positive value $h$, the value $\frac{f\left(x+h\right)-f\left(x\right)}{h}$ is the right Newton quotient at the point $x$.
 • The NewtonQuotient routine plots the secant line through the point on the graph of a function whose slope is the corresponding Newton quotient, or the value of the Newton quotient plotted with the expression and its derivative.
 > NewtonQuotient(ln(x), x=1..5, output=plot, h=1); > NewtonQuotient(sin(x)*ln(x), x=1.8, output=plot, h=.2, showderivative); > NewtonQuotient(sin(x)*ln(x), x=1..5, output=plot, h=1, showderivative);  Plotting an Inverse

 • The InversePlot routine plots the inverse of an expression $f\left(x\right)$ on an interval $\left[a,b\right]$.  The routine attempts to find the smallest interval which contains both the expression on the given range and the inverse.  For example, in plotting the inverse of $\mathrm{sin}\left(x\right)$ on $\left[2\mathrm{\pi },4\mathrm{\pi }\right]$, the interval $\left[-1,4\mathrm{\pi }\right]$ is used.
 > InversePlot(sin(x), x=2*Pi..4*Pi); > InversePlot(2*x^2 - 1, x=-2..2); > InversePlot(tan(x), x=-3..3);  Differentiation Plotting the Derivative

 • The DerivativePlot routine plots an expression with its first and higher order derivatives.
 > DerivativePlot(ln(x), x=1..5); > DerivativePlot(x^4 - 3*x^3 + 3*x + 1, x=0..2, order=1..4);  Plotting a Tangent

 • Given an expression $f\left(x\right)$ and a point $x=a$, the Tangent routine returns the slope of the tangent, the equation of the tangent line, or the plot of the tangent line and the expression.
 > Tangent(sin(x), x=3, output=line);
 ${x}{}{\mathrm{cos}}\left({3}\right){+}{\mathrm{sin}}\left({3}\right){-}{3}{}{\mathrm{cos}}\left({3}\right)$ (24)
 > Tangent(sin(x)+x, x=3, output=plot);  Function Charts

 • Given an expression, the FunctionChart routine displays a plot of the expression with extreme points and regions where the expression increases and decreases, inflection points and regions of positive and negative concavity, and optionally roots and regions where the expression is positive and negative.
 • These regions can be shown through coloring the expression, using filled regions, and arrows.
 > FunctionChart(sin(x), x=0..2*Pi); > FunctionChart((x^2 - 4*x + 2)/(x - 1), x=-3..3);  Taylor Approximation

 • Given an expression $f\left(x\right)$, a point $x=a$, and a degree $N$, the TaylorApproximation routine returns the $N$th degree Taylor approximation of an expression, a plot showing the $N$th degree Taylor approximation and the original expression, or an animation showing how the approximation changes with degree.
 > TaylorApproximation(sin(x), x=0, -5..5, degree=5);
 ${x}{-}\frac{{1}}{{6}}{}{{x}}^{{3}}{+}\frac{{1}}{{120}}{}{{x}}^{{5}}$ (25)
 > TaylorApproximation(sin(x), x=-1, degree=1..10, output=animation, view=[-5..3, DEFAULT]);  Rolle's Theorem

 • Rolle's theorem states that given an expression $f\left(x\right)$ continuous on a closed interval $\left[a,b\right]$, differentiable on the open interval $\left(a,b\right)$, and satisfying $f\left(a\right)=f\left(b\right)$, there exists a value $c$ such that $a and $f'\left(c\right)=0$.
 • The RollesTheorem routine checks that the conditions of Rolle's theorem are satisfied, finds examples of points $c$, and then plots the result.
 > RollesTheorem(sin(x), x=1..3*Pi-1, output = points);
 $\left[\frac{{\mathrm{\pi }}}{{2}}{,}\frac{{3}{}{\mathrm{\pi }}}{{2}}{,}\frac{{5}{}{\mathrm{\pi }}}{{2}}\right]$ (26)
 > RollesTheorem(sin(x), x=1..3*Pi-1); > RollesTheorem(x^3 - 4*x + 1, x=-1..1/2 + sqrt(13)/2);  The Mean Value Theorem

 • The mean value theorem states that given an expression $f\left(x\right)$ continuous on a closed interval $\left[a,b\right]$ and differentiable on the open interval $\left(a,b\right)$, there exists a value $c$ such that $a and $f'\left(c\right)=\frac{\left(f\left(b\right)-f\left(a\right)\right)}{\left(b-a\right)}$. The MeanValueTheorem routine returns the point(s) where the derivative equals the slope, or a plot showing the point(s) and the function.
 > MeanValueTheorem(cos(x), x=1..10, output = points);
 $\left[{-}{\mathrm{arcsin}}\left({-}\frac{{\mathrm{cos}}\left({10}\right)}{{9}}{+}\frac{{\mathrm{cos}}\left({1}\right)}{{9}}\right){+}{\mathrm{\pi }}{,}{2}{}{\mathrm{\pi }}{+}{\mathrm{arcsin}}\left({-}\frac{{\mathrm{cos}}\left({10}\right)}{{9}}{+}\frac{{\mathrm{cos}}\left({1}\right)}{{9}}\right){,}{3}{}{\mathrm{\pi }}{-}{\mathrm{arcsin}}\left({-}\frac{{\mathrm{cos}}\left({10}\right)}{{9}}{+}\frac{{\mathrm{cos}}\left({1}\right)}{{9}}\right)\right]$ (27)
 > MeanValueTheorem(cos(x) + x^2, x=1..10, numeric, output = points);
 $\left[{4.935793732}\right]$ (28)
 > MeanValueTheorem(cos(x), x=1..10); > MeanValueTheorem(x^4 - 3*x^2 + 4*x + 1, x=-1..4); > MeanValueTheorem(cos(x), x=1..10);  Newton's Method

 • Newton's method approximates the root of an expression by sampling it at a point, and then finding the root of the tangent line at that point.  By repeating this process, it is possible, in general, to achieve a good approximation of a root. The NewtonsMethod routine performs iterations of Newton's method.
 > NewtonsMethod(sin(x), x=2);
 ${3.141592654}$ (29)
 > NewtonsMethod(sin(x), x=2, iterations=7);
 ${3.141592654}$ (30)
 > NewtonsMethod(x^3 - 2*x^2, x=1/2, output=plot); > NewtonsMethod(x^3 - 2*x^2, x=1/2, output=animation);  Integration Approximating an Integral

 • The ApproximateInt routine approximates definite integrals using various techniques. The partitions, points selected for Riemann sums, and the method can be modified or specified by the user. Animations are used to show refinements of partitions, allowing each interval, the widest interval, or the largest rectangle to be subpartitioned.  For Newton-Cotes techniques, such as Simpson's rule, the interpolating polynomials are plotted.
 • By default, a uniform partition of 10 intervals is used with a midpoint Riemann sum.
 > ApproximateInt(sin(x), x=0..3*Pi);
 $\frac{{9}{}{\mathrm{\pi }}{}\sqrt{{2}}}{{20}}{-}\frac{{3}{}{\mathrm{\pi }}{}\sqrt{{2}}{}\sqrt{{5}}}{{20}}{+}\frac{{3}{}{\mathrm{\pi }}{}\sqrt{{5}{-}\sqrt{{5}}}}{{10}}$ (31)
 > ApproximateInt(sin(x), x=0..3*Pi, output=sum);
 $\frac{{3}{}{\mathrm{\pi }}{}\left({\sum }_{{i}{=}{0}}^{{9}}{\mathrm{sin}}\left(\frac{{3}{}\left({i}{+}\frac{{1}}{{2}}\right){}{\mathrm{\pi }}}{{10}}\right)\right)}{{10}}$ (32)
 > ApproximateInt(sin(x), x=0..3*Pi, output=plot); > ApproximateInt(sin(x), x=0..3*Pi, output=animation); > ApproximateInt(sin(x), x=0..3*Pi, output=animation, partition=random, subpartition=width, method=random); The following example is an animation using a random partition with a maximum norm of $1$, with randomly selected points at which the function is evaluated. For each iteration the widest interval is refined randomly.
 > ApproximateInt(sin(x), x=0..3*Pi, output=animation, partition=random, refinement=random, subpartition=width, method=random, iterations=40);  Plotting Antiderivatives

 • Given an expression $f\left(x\right)$, there is an arbitrary number of expressions with a derivative of $f\left(x\right)$.  The function $\int f\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$ returns one of these antiderivatives.  The AntiderivativePlot routine displays the expression and the particular antiderivative returned by the int command.
 > AntiderivativePlot(x*sin(x), x=0..3); > AntiderivativePlot(x*sin(x), x=0..3, showclass); Options can be specified to display a class of antiderivatives, or fix the value of the antiderivative returned by int at a given point.
 > AntiderivativePlot(x^2*sin(x), x=-3..3, value=<-3,0>); > AntiderivativePlot(x*cos(x), x=0..2*Pi, showclass);  Average Value of a Function

 • The average value of an expression $f\left(x\right)$ over an interval $\left[a,b\right]$ is defined as
 > 1/(b - a) * int(f(x), x=a..b);
 $\frac{{\mathrm{int}}\left({f}\left({x}\right){,}{x}{=}{a}{..}{b}\right)}{{b}{-}{a}}$ (33)
 The FunctionAverage routine returns the average value, an inert integral which can be used with the Calculus1 single-stepping routines, or a plot of $f\left(x\right)$ and a constant function the value of which is the average value of $f\left(x\right)$. Volume of Revolution

 • The volume of the shape created by rotating an expression $f\left(x\right)$ around the x-axis can be determined by solving the integral
 > VolumeOfRevolution(f(x), x=a..b, output=integral);
 ${\mathrm{Int}}\left({\mathrm{π}}{}{{f}\left({x}\right)}^{{2}}{,}{x}{=}{a}{..}{b}\right)$ (34)
 Similarly, the volume above the x-axis and under the surface created by rotating a positive-valued expression $f\left(x\right)$ (defined on a positive interval of the x-axis) around the y-axis can be determined by solving the integral
 > VolumeOfRevolution(f(x), x=a..b, axis=vertical, output=integral);
 ${\mathrm{Int}}\left({2}{}{\mathrm{π}}{}{\mathrm{abs}}\left({x}{}{f}\left({x}\right)\right){,}{x}{=}{a}{..}{b}\right)$ (35)
 The VolumeOfRevolution routine returns the volume, an inert integral representing the volume, or a plot of the volume integrated.
 > VolumeOfRevolution(sqrt(x)*cos(x), x=0..4*Pi);
 ${4}{}{{\mathrm{\pi }}}^{{3}}$ (36)
 > VolumeOfRevolution(sqrt(x)*cos(x), x=0..4*Pi, output=integral);
 ${\mathrm{Int}}\left({\mathrm{π}}{}{x}{}{{\mathrm{cos}}\left({x}\right)}^{{2}}{,}{x}{=}{0}{..}{4}{}{\mathrm{π}}\right)$ (37)
 > VolumeOfRevolution(sqrt(x)*cos(x), x=0..4*Pi, output=plot); > VolumeOfRevolution(sqrt(x)*cos(x), x=0..4*Pi, axis=vertical, output=plot); Except for a small class of examples, most volume of revolution integrals cannot be easily solved in closed form. Arc Length

 • The arc length of a curve is the length of that curve.  In the case that the curve is the graph of a differentiable function the arc length can be determined by solving the integral
 > ArcLength(f(x), x=a..b, output=integral);
 ${\mathrm{Int}}\left(\sqrt{{\left({\mathrm{diff}}\left({f}\left({x}\right){,}{x}\right)\right)}^{{2}}{+}{1}}{,}{x}{=}{a}{..}{b}\right)$ (38)
 The ArcLength routine returns the arc length; an inert integral which can be used with single-stepping functionality of the Calculus1 package; or a plot that contains the function, the integrand, and the cumulative arc length from the left end point.  The expression for the arclength can be entered in cartesian, polar, parametric-cartesian, or polar-cartesian coordinates.
 > ArcLength(x^(3/2), x=0..2);
 ${-}\frac{{8}}{{27}}{+}\frac{{22}{}\sqrt{{22}}}{{27}}$ (39)
 > ArcLength([sin(x), cos(x)], x=0..Pi);
 ${\mathrm{\pi }}$ (40)
 > ArcLength(exp(x), x=0..5, coordinates=polar);
 ${-}\sqrt{{2}}{+}\sqrt{{2}}{}{{ⅇ}}^{{5}}$ (41)
 > ArcLength(x^(3/2), x=0..2, output=integral);
 ${\mathrm{Int}}\left(\frac{{1}}{{2}}{}\sqrt{{9}{}{x}{+}{4}}{,}{x}{=}{0}{..}{2}\right)$ (42)
 > ArcLength(x^(3/2), x=0..2, output=plot); Except for a small class of examples, most arc length integrals cannot be easily solved in closed form. Surface of Revolution

 • The area of the surface created by rotating a positive valued expression $f\left(x\right)$ around the x-axis can be determined by solving the integral
 > SurfaceOfRevolution(f(x), x=a..b, output=integral);
 ${\mathrm{Int}}\left({2}{}{\mathrm{π}}{}{\mathrm{abs}}\left({f}\left({x}\right)\right){}\sqrt{{\left({\mathrm{diff}}\left({f}\left({x}\right){,}{x}\right)\right)}^{{2}}{+}{1}}{,}{x}{=}{a}{..}{b}\right)$ (43)
 Similarly, the area of the surface created by rotating an expression $f\left(x\right)$ (defined on a positive interval of the x-axis) around the y-axis can be determined by solving the integral
 > SurfaceOfRevolution(f(x), x=a..b, axis=vertical, output=integral);
 ${\mathrm{Int}}\left({2}{}{\mathrm{π}}{}{\mathrm{abs}}\left({x}\right){}\sqrt{{\left({\mathrm{diff}}\left({f}\left({x}\right){,}{x}\right)\right)}^{{2}}{+}{1}}{,}{x}{=}{a}{..}{b}\right)$ (44)
 The SurfaceOfRevolution routine returns the surface area, an inert integral representing the surface area, or a plot of the surface integrated.
 > SurfaceOfRevolution(x^(2/3), x=0..1);
 $\frac{{128}{}{\mathrm{\pi }}}{{1215}}{+}\frac{{494}{}\sqrt{{13}}{}{\mathrm{\pi }}}{{1215}}$ (45)
 > SurfaceOfRevolution(x^(2/3), x=0..1, output=integral);
 ${\mathrm{Int}}\left(\frac{{2}}{{3}}{}{\mathrm{π}}{}{{x}}^{{2}{/}{3}}{}\sqrt{\frac{{9}{}{{x}}^{{2}{/}{3}}{+}{4}}{{{x}}^{{2}{/}{3}}}}{,}{x}{=}{0}{..}{1}\right)$ (46)
 > SurfaceOfRevolution(x^(2/3), x=0..1, output=plot); > SurfaceOfRevolution(x^(2/3), x=0..1, axis=vertical, output=plot); Except for a small class of examples, most surface of revolution integrals cannot be easily solved in closed form. Example Worksheet

 • For more introductory examples, see Calculus1 Visualization Example Worksheet. List of Visualization Commands

 • The following is a list of the available Student:-Calculus1 visualization routines.

 • The colors used for the various components of the plots produced by the visualization routines can be adjusted by calling the Student:-SetColors command.