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 , 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));

 (1) 
 (2) 
 (3) 

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.

 (4) 
 (5) 
 (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.

 (7) 
>

GetProblem(1, internal);

 (8) 
 (9) 

Show the unsolved subproblem.

 (10) 
 (11) 

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

 (12) 

Create a new limit problem and apply the addition rule.

>

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

 (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);

 (14) 
 (15) 
 (16) 
>

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

Applying substitution x = 1/3*u, u = 3*x with dx = 1/3*du, du = 3*dx
 
 (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 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 ).

>

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

 (18) 

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

>

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

 (19) 
 (20) 
 (21) 
 (22) 

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

 (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:


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));

 (24) 
>

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

 (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.


