CAS Verification Demo — Automated Math Checking
Interactive examples demonstrating AutEng's Computer Algebra System (CAS) verification. See how mathematical expressions and derivations are automatically verified with SymPy.
Introduction
AutEng's Computer Algebra System (CAS) automatically verifies mathematical expressions and derivations. Every math step is either verified (✅), failed (❌), or explicitly unknown (⚠️).
This eliminates "math-looking slop" and ensures your derivations are trustworthy. The CAS uses SymPy for symbolic computation, running in a secure sandbox environment.
:::cas block with the verification mode. The system will automatically check equivalence using symbolic computation and numeric testing.Quick Start Examples
Example 1: Pythagorean Identity ✅
The fundamental trigonometric identity:
Pythagorean Identity
A fundamental trigonometric identity that always verifies as PASS
Expected Result: ✅ PASS — This identity holds for all values of x.
Example 2: Common Algebra Mistake ❌
A frequent error in algebra — the binomial expansion is wrong:
Incorrect Binomial Expansion
The CAS catches this common mistake and provides a counterexample
Expected Result: ❌ FAIL — Counterexample: a=1, b=1 gives 4 ≠ 2. The missing term is 2ab.
Example 3: Double Angle Formula ✅
Verifying a trigonometric identity:
Double Angle Formula
The sine double angle formula
Expected Result: ✅ PASS
Chain Verification (Step-by-Step Derivations)
Use mode=chain to verify multi-step algebraic derivations. Each step is checked against the previous one.
Example 4: Factoring with Assumptions
This derivation requires the assumption x ≠ 1 to allow cancellation:
Factoring with Cancellation
A derivation chain that requires assumptions to verify correctly
Expected Result: ✅ PASS — All steps verified with assumption x ≠ 1.
Example 5: Difference of Squares
Difference of Squares
Another factoring example with assumptions
Expected Result: ✅ PASS
The Power of Assumptions
Assumptions are critical for expressions involving square roots, logarithms, and division.
Example 6: Square Root Identity
Without assumptions — finds a counterexample:
Square Root Without Assumptions
This fails because √(x²) = |x|, not x
Expected Result: ❌ FAIL — Counterexample: x = -2 gives √4 = 2 ≠ -2
With the correct assumption:
Square Root With Assumptions
With x ≥ 0, the identity holds
Expected Result: ✅ PASS — With x ≥ 0, the identity holds.
Example 7: Logarithm Identities
Product rule (requires positive arguments):
Logarithm Product Rule
The product rule for logarithms
Expected Result: ✅ PASS
Inverse relationship:
Logarithm of Exponential
ln(e^x) = x for real x
Expected Result: ✅ PASS
Example 8: Invalid Logarithm Property ❌
A common mistake — this is NOT how logarithms work:
Invalid Logarithm Property
ln(x+y) ≠ ln(x) + ln(y)
Expected Result: ❌ FAIL — Counterexample found. The product rule is ln(xy), not ln(x+y).
Solution-Set Verification (mode=solve)
Use mode=solve for equation-solving derivations where steps transform solution sets rather than just expressions.
mode=solve when your derivation involves operations like dividing both sides, taking square roots, or any step that might lose or introduce solutions.Example 9: Simple Equation Solving
Simple Linear Equation
Solving a linear equation step by step
Expected Result: ✅ EQUIV — All steps preserve the solution set.
Example 10: Detecting Lost Solutions (NARROWS)
When taking a square root without ±, solutions are lost:
Lost Solutions
Taking square root without ± loses the negative solution
Expected Result: ⚠️ NARROWS — Lost solution x = -2. The first equation has {-2, 2}, but the second only has {2}.
Example 11: Correct Use of ±
Using ± preserves all solutions:
Preserving All Solutions
Using ± keeps both solutions
Expected Result: ✅ EQUIV — Both equations have solution set {-2, 2}.
Example 12: Detecting Extraneous Solutions (WIDENS)
Squaring both sides can introduce extraneous solutions:
Extraneous Solutions
Squaring introduces an extra solution
Expected Result: ⚠️ WIDENS — Added extraneous solution x = -2.
Handling Unsupported Constructs
Some mathematical constructs are not yet supported. The CAS will return UNKNOWN with helpful suggestions.
Example 13: Integrals (Not Supported)
Unsupported Integral
Integrals return UNKNOWN with suggestions
Expected Result: ⚠️ UNKNOWN — Reason: parse_unsupported. Suggestion: Integrals, sums, products, and limits are not yet supported.
Reference
Supported LaTeX Constructs
| Category | Constructs |
|---|---|
| Arithmetic | +, -, *, /, ^ |
| Fractions | \frac{a}{b} |
| Powers | x^2, x^{n+1} |
| Trigonometric | \sin, \cos, \tan, \cot, \sec, \csc |
| Inverse Trig | \arcsin, \arccos, \arctan |
| Exponential/Log | \exp, \ln, \log, e^x |
| Square Root | \sqrt{x}, \sqrt[n]{x} |
| Greek Letters | \alpha, \beta, \theta, etc. |
Not Supported (Returns UNKNOWN)
- Integrals:
\int,\iint,\oint - Sums/Products:
\sum,\prod - Limits:
\lim - Partial derivatives:
\partial - Matrices, vectors, tensors
Assumption Syntax
| Format | Meaning |
|---|---|
| x > 0 | x is positive |
| x >= 0 | x is non-negative |
| x < 0 | x is negative |
| x != 0 | x is non-zero |
| x is real | x is a real number |
| x is integer | x is an integer |
Verification Modes
| Mode | Use Case |
|---|---|
| equivalence | Single identity verification |
| chain | Step-by-step expression rewrites |
| solve | Equation-solving derivations |
Status Indicators
| Status | Meaning |
|---|---|
| ✅ PASS / EQUIV | Verified correct |
| ❌ FAIL | Proven incorrect |
| ⚠️ UNKNOWN | Cannot determine |
| ⚠️ NARROWS | Lost solutions |
| ⚠️ WIDENS | Extraneous solutions |
Best Practices
mode=solve instead of mode=chain.Next Steps
Ready to see a complete derivation with CAS verification? Check out the Quadratic Formula Derivation tutorial, which demonstrates mode=solve for equation-solving steps.
Related Content
Quadratic Formula Derivation — Step-by-Step CAS Verification
Complete derivation of the quadratic formula with automated CAS verification. Learn how mode=solve verifies equation-solving steps and detects lost or extraneous solutions.
KaTeX Syntax Quick Reference — Math Equations in Markdown
Complete reference for KaTeX mathematical notation including common formulas, symbols, and usage patterns for technical documentation.
Using KaTeX in AutEng
Practical guide to integrating mathematical equations in your documentation
Calculus in Technical Documentation — Derivatives and Integrals
Master calculus notation in technical docs with KaTeX. Learn derivatives, integrals, limits, and differential equations for software, physics, and engineering documentation.
Set Theory and Logic Notation — Mathematical Foundations
Complete guide to set theory and logic notation in technical documentation. Learn sets, operations, logic symbols, quantifiers, and proof notation with KaTeX.
Ready to Start?
Start creating beautiful technical documentation with AutEng.
Get Started with AutEng