Overview of Single Step Computation in Calculus1
•

See Student[Calculus1] for a general introduction to the Calculus1 subpackage of the Student package and a list of singlestep routines.

•

The single step functionality of the Calculus1 package enables you to solve a singlevariable calculus computation one step at a time.

•

Singlestep functionality is available for the three main types of singlevariable calculus problems: differentiation, integration, and limit.

•

To perform a single step of a calculation, use the Rule routine with two parameters: the rule to apply and the expression to which it is applied. The rule is specified by an index (in brackets) to the Rule command and the expression is passed as the argument. For example, to apply the sum rule to the expression $\frac{{\ⅆ}}{{\ⅆ}x}\left({x}^{2}\+x\right)$, enter:

>

Rule[sum](Diff(x^2+x,x));

•

The normal output from Rule is an equation where the lefthand side is the original form of the problem and the righthand side is the form of the problem after applying the rule. This output can be passed as the argument to another Rule call, the output of which has the same lefthand side and the righthand side reflects the next rule application.

•

The Calculus1 package maintains a table of problems that have been defined in singlestep mode. When Rule is invoked, its argument is checked to verify whether it matches a problem in this table. If it does not, a new entry is created for this expression in the problems table before the rule is applied. The problems table is not directly available to you (it is a private member of the Calculus1 module), but you can refer to problems in the table using commands in the package. For example, to display the current state of problem #3, enter Show(3).


A Short Example



Note: Before using the various commands from the Calculus1 package, execute the command with(Student[Calculus1]) (or with(Student:Calculus1)) so that the short form names of the package commands are available.

>

with(Student[Calculus1]):

>

infolevel[Student[Calculus1]] := 1:

>

Rule[sum](Diff(x^2+x*sin(x),x));

$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}{\+}{x}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}\right){\+}\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({x}{}{\mathrm{sin}}{}\left({x}\right)\right)$
 (1) 
$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}{\+}{x}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}{2}{}{x}{\+}\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({x}{}{\mathrm{sin}}{}\left({x}\right)\right)$
 (2) 
$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}{\+}{x}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}{2}{}{x}{\+}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}{x}\right){}{\mathrm{sin}}{}\left({x}\right){\+}{x}{}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}{\mathrm{sin}}{}\left({x}\right)\right)$
 (3) 
•

The first step in a singlestep computation is the entry of an expression which is an inert form of a limit, differentiation, or integration problem, for example, $\underset{x\→{0}^{\+}}{{lim}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}x\mathrm{ln}\left(x\right)$, $\frac{{\ⅆ}}{{\ⅆ}x}\left({x}^{2}\right)$, or ${{\∫}}_{0}^{1}x\mathrm{sin}\left(x\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}x$. In the previous example, the first call to Rule creates a new problem in the package problems table, determines that it is a differentiation problem, and then applies the sum rule for differentiation.


At any time, you can obtain the final answer by using value. You can also ask to see the complete solution using the ShowSolution command.


You can also undo one or more steps of a problem (back to its original form) by using the Undo command. This command allows you to experiment, which is useful in the study of integration techniques when it is not obvious which rule to apply.


If you do not know which rule to apply next in a singlestep computation, ask for a hint by using the Hint command. The output from Hint can be used as the rule parameter in a call to Rule.


It is recommended that you use the Maple infolevel facility by setting infolevel[Student] := 1 or infolevel[Student[Calculus1]] := 1. This displays informative messages from Calculus1 routines. In particular, explanatory text describing complicated hints is provided using this mechanism.

${\∫}{x}{}{\mathrm{cos}}{}\left({x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}$
 (4) 
$\left[{\mathrm{parts}}{\,}{x}{\,}{\mathrm{sin}}{}\left({x}\right)\right]$
 (5) 
${\∫}{x}{}{\mathrm{cos}}{}\left({x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}{\=}{x}{}{\mathrm{sin}}{}\left({x}\right){}\left({\∫}{\mathrm{sin}}{}\left({x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}\right)$
 (6) 

At this point you can continue working with this problem, return to the previous problem, get state information about either problem, or start a new problem.

${\∫}{x}{}{\mathrm{cos}}{}\left({x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}{\=}{x}{}{\mathrm{sin}}{}\left({x}\right){\+}{\mathrm{cos}}{}\left({x}\right)$
 (7) 
>

GetProblem(1, internal);

$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}{\+}{x}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}{2}{}{x}{\+}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}{x}\right){}{\mathrm{sin}}{}\left({x}\right){\+}{x}{}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}{\mathrm{sin}}{}\left({x}\right)\right)$
 (8) 
$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}{\+}{x}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}{2}{}{x}{\+}{\mathrm{sin}}{}\left({x}\right){\+}{x}{}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}{\mathrm{sin}}{}\left({x}\right)\right)$
 (9) 

Show the unsolved subproblem.

${\mathrm{\%Diff5}}{\=}\frac{{\ⅆ}}{{\ⅆ}{x}}{}{\mathrm{sin}}{}\left({x}\right)$
 (10) 
$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}{\+}{x}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}{2}{}{x}{\+}{\mathrm{sin}}{}\left({x}\right){\+}{x}{}{\mathrm{cos}}{}\left({x}\right)$
 (11) 

Use the Show routine to display the current state of problem #2.

${\∫}{x}{}{\mathrm{cos}}{}\left({x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}{\=}{x}{}{\mathrm{sin}}{}\left({x}\right){\+}{\mathrm{cos}}{}\left({x}\right)$
 (12) 

Create a new limit problem and apply the addition rule.

>

Rule[`+`](Limit(x^2+exp(x), x=1));

$\underset{{x}{\→}{1}}{{lim}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}\left({{x}}^{{2}}{\+}{{\ⅇ}}^{{x}}\right){\=}\underset{{x}{\→}{1}}{{lim}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{{x}}^{{2}}{\+}\underset{{x}{\→}{1}}{{lim}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{{\ⅇ}}^{{x}}$
 (13) 


Getting Information


•

There are three commands in the Calculus1 package that you can use to obtain information about the current state of any or all problems that are defined in a Maple session: Show, ShowSteps, and ShowIncomplete. Show is used to display the current state of a problem. ShowSteps displays all the steps between the initial and current state of the problem. ShowIncomplete is explained in the following paragraphs.


Each problem in the Calculus1 internal problems table is represented in a form that package routines use to determine, for example, when rules are applied or what is displayed. In particular, each incomplete subproblem of a problem is assigned a label. The ShowIncomplete command displays these subproblems with their labels.


You can refer to a subproblem directly by using its label as the argument to package routines, for example, Rule, Show, ShowIncomplete, and GetProblem. This focuses the corresponding routine on a particular subproblem and its subproblems, if any. In integration, differentiation, or limit problems, if a rule applies to more than one subproblem of the current problem, use the ShowIncomplete command to select a subproblem. For example:

>

Int(sin(2*x) + cos(3*x),x);

${\∫}\left({\mathrm{sin}}{}\left({2}{}{x}\right){\+}{\mathrm{cos}}{}\left({3}{}{x}\right)\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}$
 (14) 
${\∫}\left({\mathrm{sin}}{}\left({2}{}{x}\right){\+}{\mathrm{cos}}{}\left({3}{}{x}\right)\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}{\=}{\∫}{\mathrm{sin}}{}\left({2}{}{x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}{\+}{\∫}{\mathrm{cos}}{}\left({3}{}{x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}$
 (15) 
${\mathrm{\%Int13}}{\=}{\∫}{\mathrm{sin}}{}\left({2}{}{x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}$
 
${\mathrm{\%Int14}}{\=}{\∫}{\mathrm{cos}}{}\left({3}{}{x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}$
 (16) 
>

Rule[change, u=3*x](%Int14);

Applying substitution x = 1/3*u, u = 3*x with dx = 1/3*du, du = 3*dx
 
${\∫}{\mathrm{cos}}{}\left({3}{}{x}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{x}{\=}{\∫}\frac{{1}}{{3}}{}{\mathrm{cos}}{}\left({u}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\ⅆ}{u}$
 (17) 

Note: The displays produced by these three commands are printed only; they are not the return values of the commands. The return values are NULL. This means, for example, that the value of the history variable, %, is not changed by these commands. (ShowIncomplete takes an option that requests that it return its output as the value of the routine; if this option is given, the history variable is updated.)


Note: Treat subproblem labels as temporary objects because the application of a rule to a problem can change the underlying problem representation, and hence the subproblem labels. It is recommended that you call ShowIncomplete to verify the value of a label before passing it to a command.



Learning


•

The methods of singlevariable calculus computation proceed from simple (for example, the constant rule for limits) to challenging (for example, change of variables for integration). It would be tedious if you were required to explicitly apply the elementary rules when learning the more advanced methods.


The Calculus1 package provides the Understand command to alleviate this problem. For example, if you execute the $\mathrm{Student:Calculus1:Understand}\left(\mathrm{Diff}\,\mathrm{constant}\,\mathrm{c*}\,\mathrm{`+`}\right)$ command, whenever you invoke Rule on a differentiation problem it automatically checks whether one or more of the constant, constantmultiple, or sum rules can also be applied. You can apply just the understood rules to a problem by calling Rule with an empty index (that is, as ${\mathrm{Student:Calculus1:Rule}}_{\[\]}\left(\mathrm{expr}\right)$).

>

Understand(Diff, constant, `c*`, `+`);

${\mathrm{Diff}}{\=}\left[{\mathrm{constant}}{\,}{\mathrm{constantmultiple}}{\,}{\mathrm{sum}}\right]$
 (18) 

Create a new problem. The understood rules are automatically applied.

>

Rule[](Diff(3*sqrt(x)sin(x), x));

$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({3}{}\sqrt{{x}}{}{\mathrm{sin}}{}\left({x}\right)\right){\=}{3}{}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left(\sqrt{{x}}\right)\right){}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}{\mathrm{sin}}{}\left({x}\right)\right)$
 (19) 
$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left(\sqrt{{{x}}^{{2}}{\+}{1}}\right)$
 (20) 
$\left[{\mathrm{chain}}\right]$
 (21) 
$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left(\sqrt{{{x}}^{{2}}{\+}{1}}\right){\=}\left(\genfrac{}{}{0ex}{}{\frac{{\ⅆ}}{{\ⅆ}{\mathrm{\_X}}}{}\left(\sqrt{{\mathrm{\_X}}}\right)}{\phantom{{\mathrm{\_X}}{\=}{{x}}^{{2}}{\+}{1}}}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{}\phantom{\rule[0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0ex}{}{\phantom{\frac{{\ⅆ}}{{\ⅆ}{\mathrm{\_X}}}{}\left(\sqrt{{\mathrm{\_X}}}\right)}}{{\mathrm{\_X}}{\=}{{x}}^{{2}}{\+}{1}}\right){}\left(\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}\right)\right)$
 (22) 

Note: The sum and constant rules have been applied to the derivative of the inner expression.

$\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left(\sqrt{{{x}}^{{2}}{\+}{1}}\right){\=}\frac{{1}}{{2}}{}\frac{\frac{{\ⅆ}}{{\ⅆ}{x}}{}\left({{x}}^{{2}}\right)}{\sqrt{{{x}}^{{2}}{\+}{1}}}$
 (23) 


More Details and Cautions



Internal Representation of Problems



The Calculus1 package attempts to keep expressions as simple as possible. However, for example, after a change of variables rule is applied to an integral, the resulting integrand may not be simplified. In such circumstances, it may be beneficial to apply standard Maple commands (for example, normal, simplify, or expand) to the output of the Rule command; the symbolic option, available with certain of these commands, and the assuming operator may be helpful.


These commands have no effect on the lefthand side of any equation returned by Rule. Although the displayed form of a lefthand side is typically a standard limit, derivative, or integral, the underlying representation of this object is different. If you use the lprint command, Maple displays its structure, which is similar to:

$\mathrm{CALCULUS1OBJECT}\left(\left[1\,\left[\right]\,\left[\right]\right]\,\left\{x\right\}\right)\=\mathrm{...}$

This underlying representation allows the package to continue solving a problem after you apply a command, such as normal or simplify, to an expression before passing it to Rule. Thus, always pass the entire equation as the argument to Rule, not just its righthand side.


Most Maple commands do not accept CALCULUS1OBJECTs (the exceptions are diff, int, limit, and series). To work with both sides of an equation returned by a call to Rule, first transform its lefthand side into standard form by using the GetProblem routine (without the internal option).


To use GetProblem to change the current problem or recover the current problem (see the following paragraph), use the internal option to ensure that the equation returned uses the CALCULUS1OBJECT representation for its lefthand side.


If you create a problem by passing the first reference to an expression directly to Hint, there is no representation of the problem outside the internal Calculus1 problems table. That is, there is no reference to it. Use GetProblem(internal) to pass the problem as an argument to Rule.

>

Hint(Limit(x*ln(x), x=0, right));

$\left[{\mathrm{lhopital}}{\,}{\mathrm{ln}}{}\left({x}\right)\right]{\,}\left[{\mathrm{lhopital}}{\,}{x}\right]$
 (24) 
>

Rule[(24)](GetProblem(internal));

$\underset{{x}{\→}{{0}}^{{\+}}}{{lim}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{x}{}{\mathrm{ln}}{}\left({x}\right){\=}\underset{{x}{\→}{{0}}^{{\+}}}{{lim}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}\left({}{x}\right)$
 (25) 


Internal State of Problems



As discussed above, you can apply standard Maple commands, such as normal or expand, to the output from a Rule call. However, because these commands are not part of the Calculus1 package, they do not modify the internal state of a problem. Therefore, if you follow such a command with GetProblem(), the state of the problem is as it was after the last Rule call. Similarly, if you use Show, ShowSteps, or ShowIncomplete, you do not see the result of the standard Maple command.


However, as noted previously, if you pass the result of the application of a standard Maple command to Rule or Hint, the internal state of the problem is updated with this new state before the command runs.



Multiple Hints



For challenging problems, a call to Hint may return more than one suggestion. The value returned from the call to Hint is then an expression sequence of lists, where each list is a rule.


You can simply refer to this list as % in the index to Rule; in this case, Rule uses the first rule in the sequence. This means that the construct Rule[Hint(%)](%) is always valid (assuming that % refers to a calculus problem that is valid input to Rule).


You can also select other hints by referring to %[2] or %[3], for example.




Example Worksheet


•

The following is a list of the available Student[Calculus1] singlestepping routines.






