Shape an expressionLesson 12 of 48 · 7 min
Simplify towards a goal
Select a targeted transformation and verify the relationship between forms.
Maths refresher: Identity versus one example
An identity holds throughout a stated domain. Agreement at one input is weaker evidence.
The difference expands to zero for every x. In contrast, happens at and but is not an identity.
There is no single best-looking form of every expression. A factored polynomial, expanded sum and trigonometric identity may each suit a different task. simplify applies broad heuristics; targeted functions express a clearer intention.
Use trigsimp for trigonometric identities, factor for polynomial products and cancel for rational factors. Comparing structure with == asks whether objects have the same representation, not whether every algebraically equivalent pair is written identically.
For suitable expressions, simplifying their difference to zero is a useful identity check. Failure to reach zero is not a proof of inequality: symbolic equivalence is difficult in general. Combine the check with assumptions and domain reasoning, and distinguish identity from agreement at a few numerical points.
Can two equivalent polynomial expressions compare unequal with structural ==?
Write a prediction (optional)
Exact symbolic investigation
Select Run Python with the code unchanged.
Your saved draft is open. To use the published code, select Restore example in Tools. Use Recover draft to bring back your code.
Tools
About Python
Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗
Ctrl+Enter or ⌘+Enter runs Python.
Execution error
Technical error details
Your result
Python text output
Compare with the worked example
Executed from the published Python during the site build. Your own run appears above. Build environment ↗
Worked text output
Structural equality: False Polynomial identity check: 0 Factored difference: 0 Differences at x=0, 1, 2: [0, 0, 0] Trigonometric simplification: 1
Read the starter result
Structural equality is false for the starter because the expressions have different forms. The zero Polynomial identity check shows their difference vanishes for this polynomial.
Edit and compare
Replace a,b = (x+1)**2,x**2+2*x+1 with a,b = x**2,x. Select Run Python. Compare Differences at x=0, 1, 2 with Factored difference. Which inputs agree, and what does the difference say about an identity?
Scope. No single simplification or numerical sampling strategy decides equivalence for all possible symbolic expressions.
Try a fresh case
Two formulas match at and . What does that establish?
Need a hint?
Hint 1
Consider x² and x.
Hint 2
A claim about all inputs needs a reason covering the domain.