Symbolic maths
Most maths blocks produce a number. The symbolic operations, simplify, expand, factor, derivative, solve and integrate, produce another expression instead, so you can rearrange algebra, factorise a polynomial, differentiate or integrate a formula, or find the roots of an equation without working them out by hand.
A symbolic result is shown after the usual , as maths rather than a figure. Type derivative(x^3 + 2x, x) and the block reads:
The two rules
Section titled “The two rules”Nearly everything about symbolic maths follows from two rules. Both exist so that symbolic results behave like the rest of your calcsheet rather than as a separate world.
1. Names you have defined are substituted
Section titled “1. Names you have defined are substituted”Anything the sheet defines above the block is substituted into the expression before the operation runs: plain values as constants, and your own functions by their definitions.
So with earlier on the sheet:
The one exception is the variable the operation is about, the in derivative(…, x). That one stays symbolic even if the sheet gives it a value, which is what makes the result meaningful.
2. The result becomes a number once nothing is unknown
Section titled “2. The result becomes a number once nothing is unknown”While anything in the result is still unknown, the result stays an expression. As soon as every name in it is defined, it is evaluated and behaves exactly like any other numeric result.
That is why the shielded variable does not cost you anything. With above the block:
The differentiation still happens on , giving rather than the derivative of the constant , and only then is applied, to give .
The same block therefore changes character depending on what is defined. With only on the sheet:
Add and the identical block reads .
simplify
Section titled “simplify”Collects like terms, cancels what a numerator and denominator share, and knows the standard identities:
The third has nothing unknown left in it, so by rule 2 it is a plain number, as usable as any other result.
Roots stay exact: , rather than a decimal.
It never assumes a sign. As far as the calcsheet knows, any name could be negative, so simplifies to and to (correct, if not always what you wanted for a length).
expand
Section titled “expand”Multiplies out brackets and powers of sums, then collects the terms that result:
factor
Section titled “factor”The reverse of expand: it writes a polynomial as a product of factors.
A common factor comes out front, a repeated factor becomes a power, and a factor with no real roots stays a quadratic.
It factorises over the rationals: every coefficient in a factor is a whole number or a fraction. So comes back exactly as you typed it. Its factors exist, just not with rational coefficients.
What it won’t do:
- Much with two or more variables. It finds a difference of two squares (), a perfect square () and a numeric common factor, and nothing else. comes back unfactored, not as . One variable is where it shines.
- Tidy a leading coefficient. It goes out front, so gives rather than . Same polynomial.
- Fractions. Those are
simplify’s job, which factorises the top and bottom and cancels: .
derivative
Section titled “derivative”Differentiates an expression with respect to the variable you name last. The full chain rule applies:
Reusing a derivative as a function
Section titled “Reusing a derivative as a function”Because of rule 2, a derivative assigned to a function is a genuine, callable function: the variable is bound when you call it:
This works through your own functions too, however deeply they are defined in terms of one another.
Second derivatives
Section titled “Second derivatives”Differentiate a function that is itself a derivative, written exactly as you would expect:
You can also nest the operations directly in one block, innermost first:
Finds the roots of an equation in the variable you name last. Write it either as an expression that equals zero, or as an equation. Both give the same answer:
Both return every root, as a vector, with the real roots in ascending order, and here, so the result reads the same way each time.
integrate
Section titled “integrate”Finds the antiderivative of an expression with respect to the variable you name last, with no constant of integration:
Because of rule 2, is a callable function, and an exact definite integral. Integration also nests with the other operations: differentiate the result and you get the expression back.
With limits, integrate(expression, x, a, b) is a different thing: a definite integral, worked out numerically, so its answer is always a number. Integrals covers both, including the integral sign as a third spelling and what the formula can’t do.
The arrow spelling
Section titled “The arrow spelling”Every operation has a second spelling: Mathcad’s symbolic arrow, written (if you grew up on Mathcad, your thumbs already know it). Type -> in a maths block, or use the toolbar, and the operation goes after the expression:
Where the operation needs a variable, it follows the keyword after a comma:
This is only a different way of writing the same operations, not a different feature, and both spellings behave identically. An arrow works on the right-hand side of a definition, and makes a callable function just as the function-call form does:
A bare arrow means simplify
Section titled “A bare arrow means simplify”An arrow with no keyword after it asks for the expression to be worked out symbolically, which here means simplify:
Chaining arrows
Section titled “Chaining arrows”Several arrows apply left to right, so this expands first and then simplifies the result:
What counts as an arrow
Section titled “What counts as an arrow”Only an arrow at the top level of the expression is the symbolic operator. An arrow inside brackets belongs to whatever you wrote it for and is left alone.
If you use a keyword the arrow does not recognise, the block tells you which six it does know: simplify, expand, factor, derivative, solve and integrate.
Inserting from the toolbar
Section titled “Inserting from the toolbar”The maths toolbar has a Symbolics group containing both spellings:
- → on its own, then →simplify, →expand, →factor, →solve, →derivative and →integrate for the arrow form. Each keyword button writes the whole , which also keeps the keyword upright rather than leaving it in the italic maths face.
- derivative(), integrate(), solve(), simplify(), expand() and factor() for the function-call form: the spelling that nests inside another operation, and the one autosuggest offers as you type.
- ∫dx, the integral sign without limits: the antiderivative written as typeset maths.
For →solve, →derivative and →integrate, the variable is left as an empty placeholder for you to fill in.
Switching between the two spellings
Section titled “Switching between the two spellings”Right-click a maths block whose result is a symbolic operation and choose Show as Arrow or Show as Function Call to rewrite it the other way. Nested operations are unwrapped as it goes, so becomes the chain rather than a half-converted mixture.
The toggle appears only when the operation is the whole expression, or the whole right-hand side of a definition. One buried inside a larger expression has no arrow spelling of its own. Switching is a normal edit: one undo step, and autosaved like any other change.
Working with units
Section titled “Working with units”A name holding a value with units stays symbolic through the operation, then has its value worked back in once nothing else is unknown. The same goes for a name holding a matrix or another symbolic result: only plain numbers and your own functions are substituted into the expression itself. With L := 3.m on the sheet:
Add and the same block gives , units and all.
Things to know
Section titled “Things to know”- A symbolic result is not a number. If you use a name holding an expression where a number is wanted, the block tells you so, and names what the expression is still waiting to know. Define the remaining unknowns and it resolves itself.
simplify,expandandfactorcheck their answers. Each answer is tested numerically against your expression before it is shown, and one that fails is never shown. You get a plainer answer instead, with no error: forfactor, your expression as written.- Decimal places and result-unit overrides do not apply while a result is still an expression: there is no figure to round and no value to convert. Both come back as soon as the result evaluates to a number. A decimal coefficient inside an expression is shown to six significant figures.
- Subscripted and Greek names are preserved in the result, so typing
F_cycomes back as , exactly as you typed it. - A definition that refers to itself, or definitions nested more than eight deep, cannot be worked out symbolically – the block says so rather than hanging.
- A sheet variable named after an operation shadows it, exactly as it does for any other built-in function.
See also
Section titled “See also”- Symbolic functions: signatures, limits and messages at a glance
- Integrals: the antiderivative in full, and the numerical definite integral
