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 single-step routines.
The single step functionality of the Calculus1 package enables you to solve a single-variable calculus computation one step at a time.
Single-step functionality is available for the three main types of single-variable 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 ⅆⅆxx2+x, enter:
The normal output from Rule is an equation where the left-hand side is the original form of the problem and the right-hand 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 left-hand side and the right-hand side reflects the next rule application.
For detailed information on rules for differentiation, integration, and limits, see Differentiation Rules, Integration Rules, and Limit Rules.
The Calculus1 package maintains a table of problems that have been defined in single-step 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
More Details and Cautions
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.
infolevel[Student[Calculus1]] := 1:
Creating problem #1
The first step in a single-step computation is the entry of an expression which is an inert form of a limit, differentiation, or integration problem, for example, limx→0+⁡x⁢ln⁡x, ⅆⅆxx2, or ∫01x⁢sin⁡xⅆ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 single-step 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.
Create a new problem.
Creating problem #2
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.
Finish problem #2.
Return to problem #1.
Apply the identity rule.
Show the unsolved subproblem.
Apply the sin rule.
Use the Show routine to display the current state of problem #2.
Create a new limit problem and apply the addition rule.
Creating problem #3
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);
Creating problem #4
Applying substitution x = 1/3*u, u = 3*x with dx = 1/3*du, du = 3*dx
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.
The methods of single-variable 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 Understand⁡Diff,constant,c*,`+` 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 Rule⁡expr).
Understand(Diff, constant, `c*`, `+`);
Create a new problem. The understood rules are automatically applied.
Creating problem #5
Request a hint.
Creating problem #6
Apply the hint.
Note: The sum and constant rules have been applied to the derivative of the inner expression.
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 left-hand side of any equation returned by Rule. Although the displayed form of a left-hand 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 right-hand 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 left-hand 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 left-hand 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));
Creating problem #7
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.
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 % or %, for example.
For more introductory examples, see Calculus1 Single Stepping Example Worksheet.
The following is a list of the available Student:-Calculus1 single-stepping routines.
Calculus1 Single Stepping Example Worksheet
Download Help Document
What kind of issue would you like to report? (Optional)