Student[Basics]
ExpandSteps
generate core steps in expanding polynomial products
Calling Sequence
Parameters
Description
Examples
Compatibility
ExpandSteps( expr )
ExpandSteps( expr, implicitmultiply = true )
expr
-
string or expression
implicitmultiply
(optional) truefalse
The ExpandSteps command accepts a product of polynomials and displays the steps required to expand the expression.
If expr is a string, then it is parsed into an expression using InertForm:-Parse so that no automatic simplifications are applied, and thus no steps are missed.
The implicitmultiply option is only relevant when expr is a string. This option is passed directly on to the InertForm:-Parse command and will cause things like 2x to be interpreted as 2*x, but also, xyz to be interpreted as x*y*z.
A step may show up where the expression is not obviously different from the previous step. This can happen when the underlying data structure is transformed during the step, and it is not obvious that the resulting structure is the same as the original, but just expressed differently. This becomes more apparent when looking at the inert form of the raw data.
The return value is a module that displays annotated steps by default. This module also has callable methods and data members: data, numsteps, step, and toMathML.
data: a numsteps x 2 array where column 1 is the inert-form expression, and column 2 is the annotation. R:-data[1,1] is the original expression in inert form.
numsteps: the number of steps in the solution, including the original expression.
step(i): a method for displaying individual steps. Calling R:-step(i) displays the ith typeset expression and annotation. Step 1 is the original expression.
toMathML(): a method for converting the sequence of steps and annotations into mathml. The toMathML command optionally takes one or two arguments: (1) a filename, indicating the mathml should be written to the specified file, and (2) the option htmlheader=true, which also causes html tags to be written along with the mathml, thus generating a complete .html page that can be loaded in a browser.
This function is part of the Student:-Basics package.
with⁡Student:-Basics:
ExpandSteps⁡a2−1a3+13
a2−1a3+13=a+1⋅a−1a+1⋅13Factor=a−113divide=a−1⋅31Rewrite division as multiplication by reciprocal=3⁢a−3Multiply fraction and reduce by gcd
Note that the result is a module with callable methods
ex≔ExpandSteps⁡3⁢a⁢4⁢a−y+42
ex≔3⋅a⋅4⋅a−1⋅y+42=12⁢a2−3⁢a⁢y+126⁢aMultiply through:3⁢a⋅4⁢a−y+42=12⁢a2−3⁢a⁢y+126⁢a
ex:-numsteps
2
ex:-step⁡2
12⁢a2−3⁢a⁢y+126⁢aMultiply through:3⁢a⋅4⁢a−y+42=12⁢a2−3⁢a⁢y+126⁢a
The steps can be converted to MathML
ex:-toMathML⁡
<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle scriptminsize='8.0pt'><mrow><mn>3</mn><mo> </mo><mi>a</mi><mo> </mo><mfenced><mrow><mrow><mn>4</mn><mo> </mo><mi>a</mi></mrow><mo>−</mo><mrow><mn>1</mn><mo> </mo><mi>y</mi></mrow><mo>+</mo><mn>42</mn></mrow></mfenced></mrow></mstyle></math> <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle scriptminsize='8.0pt'><mtext>=</mtext><mspace width='5px'><mrow><mrow><mn>12</mn><mo> </mo><msup><mi>a</mi><mn>2</mn></msup></mrow><mo>−</mo><mrow><mn>3</mn><mo> </mo><mi>a</mi><mo> </mo><mi>y</mi></mrow><mo>+</mo><mrow><mn>126</mn><mo> </mo><mi>a</mi></mrow></mrow>‖<mspace width='10px'><mtext color='blue'>( ‖_MTEXT⁡Multiply through: %1 = %2,3⁢a∗4⁢a−y+42,12⁢a2−3⁢a⁢y+126⁢a‖ )</mtext>‖</mstyle></math>
The input can be a string, which prevents automatic simplification
ExpandSteps⁡(1+1)*(3-1)
1+1⋅3−1=2⋅3−1Add terms=2⋅2Add terms=4Multiply constants
The implicitmultiply option allows shorthand for string input.
ExpandSteps⁡2.1yx^2/(4.3xy),implicitmultiply
2.1⋅y⋅x24.3⋅x⋅y=2.1⋅x24.3⋅xdivide out common terms=2.100000000⁢x4.3divide out common terms=0.4883720930⁢xDivide constants
The Student[Basics][ExpandSteps] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
Student:-Basics
Student:-Basics:-LinearSolveSteps
Student:-Calculus1:-ShowSolution
Student:-Calculus1:-ShowSteps
Download Help Document