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);
|
| (1) |
>
|
FunctionAverage(sin(x), x=0..10);
|
>
|
FunctionAverage(sin(x), x=0..10, output=integral);
|
| (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);
|
| (4) |
>
|
Rule[constantmultiple]((4));
|
| (5) |
>
|
Rule[change, u=exp(x)]((5));
|
| (6) |
| (7) |
| (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(sin(x), maxsols=3);
|
>
|
Roots(sin(x), x=10..20);
|
| (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 , though this can be modified by using extra parameters.
|
>
|
Asymptotes((x^2 - 4*x + 1)/x);
|
>
|
Asymptotes(tan(x - 1));
|
| (14) |
>
|
Asymptotes(tan(x - 1), x=20..25);
|
| (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);
|
>
|
ExtremePoints((x^4 - 4*x^3 - 4*x)/x);
|
|
|
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);
|
>
|
ExtremePoints((x^4 - 4*x^3 - 4*x)/x, x=-3..3);
|
>
|
ExtremePoints(sin(x), x=-10..infinity);
|
| (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);
|
>
|
InflectionPoints(1/x^2);
|
>
|
InflectionPoints(csc(x), -10..10);
|
|
|
|
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 , the value is the right Newton quotient at the point .
|
•
|
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 on an interval . 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 on , the interval 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 and a point , 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);
|
| (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 , a point , and a degree , the TaylorApproximation routine returns the th degree Taylor approximation of an expression, a plot showing the 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);
|
>
|
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 continuous on a closed interval , differentiable on the open interval , and satisfying , there exists a value such that and .
|
•
|
The RollesTheorem routine checks that the conditions of Rolle's theorem are satisfied, finds examples of points , and then plots the result.
|
>
|
RollesTheorem(sin(x), x=1..3*Pi-1, output = points);
|
| (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 continuous on a closed interval and differentiable on the open interval , there exists a value such that and . 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);
|
| (27) |
>
|
MeanValueTheorem(cos(x) + x^2, x=1..10, numeric, output = points);
|
>
|
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);
|
>
|
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);
|
|
|
|
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);
|
| (31) |
>
|
ApproximateInt(sin(x), x=0..3*Pi, output=sum);
|
| (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[1], subpartition=width, method=random);
|
|
The following example is an animation using a random partition with a maximum norm of , 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);
|
|
|
Plotting Antiderivatives
|
|
•
|
Given an expression , there is an arbitrary number of expressions with a derivative of . The function 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 over an interval is defined as
|
>
|
1/(b - a) * int(f(x), x=a..b);
|
| (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 and a constant function the value of which is the average value of .
|
|
|
Volume of Revolution
|
|
•
|
The volume of the shape created by rotating an expression around the x-axis can be determined by solving the integral
|
>
|
VolumeOfRevolution(f(x), x=a..b, output=integral);
|
| (34) |
|
Similarly, the volume above the x-axis and under the surface created by rotating a positive-valued expression (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);
|
| (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);
|
>
|
VolumeOfRevolution(sqrt(x)*cos(x), x=0..4*Pi, output=integral);
|
| (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);
|
| (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);
|
>
|
ArcLength([sin(x), cos(x)], x=0..Pi);
|
>
|
ArcLength(exp(x), x=0..5, coordinates=polar);
|
| (41) |
>
|
ArcLength(x^(3/2), x=0..2, output=integral);
|
| (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 around the x-axis can be determined by solving the integral
|
>
|
SurfaceOfRevolution(f(x), x=a..b, output=integral);
|
| (43) |
|
Similarly, the area of the surface created by rotating an expression (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);
|
| (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);
|
| (45) |
>
|
SurfaceOfRevolution(x^(2/3), x=0..1, output=integral);
|
| (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
|
|
|
|
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.
|
|
|
|
|
|
|