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.
Properties
Roots
Asymptotes
Critical Points
Extreme Points
Points of Inflection
Preliminary Routines
Shortcomings of Point Interpolation
Newton Quotients
Plotting an Inverse
Differentiation
Plotting the Derivative
Plotting a Tangent
Function Charts
Taylor Approximation
Rolle's Theorem
The Mean Value Theorem
Newton's Method
Integration
Approximating an Integral
Plotting Antiderivatives
Average Value of a Function
Volume of Revolution
Arc Length
Surface of Revolution
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);
−5,−2,2,2,5
FunctionAverage(sin(x), x=0..10);
110−cos⁡1010
FunctionAverage(sin(x), x=0..10, output=integral);
∫010sin⁡xⅆx10
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);
∫12π⁢ⅇx2ⅆx
Rule[constantmultiple]((4));
∫12π⁢ⅇx2ⅆx=π⁢∫12ⅇx2ⅆx
Rule[change, u=exp(x)]((5));
∫12π⁢ⅇx2ⅆx=π⁢∫ⅇⅇ2uⅆu
Rule[power]((6));
∫12π⁢ⅇx2ⅆx=π⁢ⅇ222−ⅇ22
simplify((7));
∫12π⁢ⅇx2ⅆx=π⁢ⅇ2⁢ⅇ2−12
Example Worksheet
List of Visualization Commands
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.
The Roots routine returns the roots of the given expression.
Roots(x^2 - 4*x + 1);
2−3,2+3
Roots(sin(x), maxsols=3);
Warning, the expression may have an infinite number of roots, some examples of which are given
−π,0,π
Roots(sin(x), x=10..20);
4⁢π,5⁢π,6⁢π
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);
y=x−4,x=0
Asymptotes(sin(x)/x);
y=0
Asymptotes(tan(x - 1));
Warning, the expression has an infinite number of potential vertical asymptotes, some examples of which are given
x=1−π2,x=1+π2,x=1+3⁢π2
Asymptotes(tan(x - 1), x=20..25);
x=1+13⁢π2,x=1+15⁢π2
The CriticalPoints routine returns all points where the derivative is zero or undefined.
CriticalPoints((x^4 - 4*x^3 - 4*x)/x);
83
ExtremePoints((x^4 - 4*x^3 - 4*x)/x);
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, x=-3..3);
−3,83,3
ExtremePoints(sin(x), x=-10..infinity);
Warning, the expression has an infinite number of extreme points, some examples of which are given
−10,−5⁢π2,−3⁢π2,−π2
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);
223
InflectionPoints(1/x^2);
InflectionPoints(csc(x), -10..10);
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 approximate the slope of an expression at a point by sampling the expression at nearby points. For a positive value h, the value f⁡x+h−f⁡xh 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);
The InversePlot routine plots the inverse of an expression f⁡x on an interval a,b. 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 sin⁡x on 2⁢π,4⁢π, the interval −1,4⁢π is used.
InversePlot(sin(x), x=2*Pi..4*Pi);
InversePlot(2*x^2 - 1, x=-2..2);
InversePlot(tan(x), x=-3..3);
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);
Given an expression f⁡x 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⁢cos⁡3+sin⁡3−3⁢cos⁡3
Tangent(sin(x)+x, x=3, output=plot);
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);
Given an expression f⁡x, a point x=a, and a degree N, the TaylorApproximation routine returns the Nth degree Taylor approximation of an expression, a plot showing the Nth 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−16⁢x3+1120⁢x5
TaylorApproximation(sin(x), x=-1, degree=1..10, output=animation, view=[-5..3, DEFAULT]);
Rolle's theorem states that given an expression f⁡x continuous on a closed interval a,b, differentiable on the open interval a,b, and satisfying f⁡a=f⁡b, there exists a value c such that a<c<b and f'⁡c=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);
π2,3⁢π2,5⁢π2
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 states that given an expression f⁡x continuous on a closed interval a,b and differentiable on the open interval a,b, there exists a value c such that a<c<b and f'⁡c=f⁡b−f⁡ab−a. 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);
−arcsin⁡−cos⁡109+cos⁡19+π,2⁢π+arcsin⁡−cos⁡109+cos⁡19,−arcsin⁡−cos⁡109+cos⁡19+3⁢π
MeanValueTheorem(cos(x) + x^2, x=1..10, numeric, output = points);
4.935793732
MeanValueTheorem(cos(x), x=1..10);
MeanValueTheorem(x^4 - 3*x^2 + 4*x + 1, x=-1..4);
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
NewtonsMethod(sin(x), x=2, iterations=7);
NewtonsMethod(x^3 - 2*x^2, x=1/2, output=plot);
NewtonsMethod(x^3 - 2*x^2, x=1/2, output=animation);
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);
9⁢π⁢220−3⁢π⁢2⁢520+3⁢π⁢5−510
ApproximateInt(sin(x), x=0..3*Pi, output=sum);
3⁢π⁢∑i=09⁡sin⁡3⁢i+12⁢π1010
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[1], 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[1], refinement=random, subpartition=width, method=random, iterations=40);
Given an expression f⁡x, there is an arbitrary number of expressions with a derivative of f⁡x. The function ∫f⁡xⅆ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);
The average value of an expression f⁡x over an interval a,b is defined as
1/(b - a) * int(f(x), x=a..b);
∫abf⁡xⅆxb−a
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⁡x and a constant function the value of which is the average value of f⁡x.
The volume of the shape created by rotating an expression f⁡x around the x-axis can be determined by solving the integral
VolumeOfRevolution(f(x), x=a..b, output=integral);
∫abπ⁢f⁡x2ⅆx
Similarly, the volume above the x-axis and under the surface created by rotating a positive-valued expression f⁡x (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);
∫ab2⁢π⁢x⁢f⁡xⅆx
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⁢π3
VolumeOfRevolution(sqrt(x)*cos(x), x=0..4*Pi, output=integral);
∫04⁢ππ⁢x⁢cos⁡x2ⅆx
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.
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);
∫abⅆⅆxf⁡x2+1ⅆx
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);
−827+22⁢2227
ArcLength([sin(x), cos(x)], x=0..Pi);
π
ArcLength(exp(x), x=0..5, coordinates=polar);
−2+2⁢ⅇ5
ArcLength(x^(3/2), x=0..2, output=integral);
∫029⁢x+42ⅆx
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.
The area of the surface created by rotating a positive valued expression f⁡x around the x-axis can be determined by solving the integral
SurfaceOfRevolution(f(x), x=a..b, output=integral);
∫ab2⁢π⁢f⁡x⁢ⅆⅆxf⁡x2+1ⅆx
Similarly, the area of the surface created by rotating an expression f⁡x (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);
∫ab2⁢π⁢x⁢ⅆⅆxf⁡x2+1ⅆx
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);
128⁢π1215+494⁢13⁢π1215
SurfaceOfRevolution(x^(2/3), x=0..1, output=integral);
∫012⁢π⁢x23⁢9⁢x23+4x233ⅆx
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.
For more introductory examples, see Calculus1 Visualization Example Worksheet.
The following is a list of the available Student:-Calculus1 visualization routines.
AntiderivativePlot
ApproximateInt
ArcLength
DerivativePlot
FunctionAverage
FunctionChart
InversePlot
MeanValueTheorem
NewtonQuotient
NewtonsMethod
PointInterpolation
RiemannSum
RollesTheorem
SurfaceOfRevolution
Tangent
TaylorApproximation
VolumeOfRevolution
The colors used for the various components of the plots produced by the visualization routines can be adjusted by calling the Student:-SetColors command.
See Also
Calculus1 Visualization Example Worksheet
Student
Student:-Calculus1
Student[Calculus1][InteractiveOverview]
Student[Calculus1][SingleStepOverview]
Download Help Document