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.

Introduction

This tutorial demonstrates the mode=solve feature by deriving the quadratic formula with step-by-step CAS verification. You'll learn why mode=solve is essential for equation-solving derivations and how it detects lost or extraneous solutions.

Why mode=solve?
The quadratic formula derivation involves operations that transform solution sets rather than just expressions. Dividing both sides by a is NOT an algebraic equivalence (the expressions differ by factor a), but the equations have the same solutions when a ≠ 0.

Understanding the Difference

Let's understand why mode=chain fails for equation-solving derivations:

ModeWhat It ChecksUse For
chainAlgebraic equivalence: simplify(expr1 - expr2) == 0Factoring, expanding, simplifying
solveSolution-set equivalence: solveset(eq1) == solveset(eq2)Equation solving, isolating variables

Consider the step "divide both sides by a":

  • ax² + bx and x² + (b/a)x are NOT algebraically equivalent
  • But the equations ax² + bx = -c and x² + (b/a)x = -c/a have the SAME solution set

The Derivation

Step 1: Start with the General Quadratic Equation

We begin with the standard form of a quadratic equation where a ≠ 0:

General Quadratic Equation

The starting point of our derivation

ax2+bx+c=0ax^2 + bx + c = 0ax2+bx+c=0

where a0a \neq 0a=0.

Step 2: Subtract c from Both Sides

Subtract c

Moving the constant term to the right side

Not Verified
Assumptions: a != 0
1
ax2+bx+c=0ax^2 + bx + c = 0
2
ax2+bx=cax^2 + bx = -c

Expected Result: ✅ EQUIV (same solution set)

Step 3: Divide Both Sides by a

This is where mode=solve shines. This step would FAIL with mode=chain because the expressions are NOT algebraically equivalent.

Divide by a

This step requires mode=solve because expressions differ by factor a

Not Verified
Assumptions: a != 0
1
ax2+bx=cax^2 + bx = -c
2
x2+bax=cax^2 + \frac{b}{a}x = -\frac{c}{a}

Expected Result: ✅ EQUIV (same solution set when a ≠ 0)

Why mode=chain Would Fail Here
mode=chain checks if ax² + bx equals x² + (b/a)x. These are NOT equal (they differ by factor a). But mode=solve checks if the equations have the same solutions, which they do.

Step 4: Complete the Square

Add (b/2a)² to both sides:

Complete the Square

Adding (b/2a)² to both sides

Not Verified
Assumptions: a != 0
1
x2+bax=cax^2 + \frac{b}{a}x = -\frac{c}{a}
2
x2+bax+b24a2=b24a2cax^2 + \frac{b}{a}x + \frac{b^2}{4a^2} = \frac{b^2}{4a^2} - \frac{c}{a}

Expected Result: ✅ EQUIV

Step 5a: Simplify the Right Side

Combine the fractions on the right side:

Simplify Right Side

Combining fractions

Not Verified
Assumptions: a != 0
1
x2+bax+b24a2=b24a2cax^2 + \frac{b}{a}x + \frac{b^2}{4a^2} = \frac{b^2}{4a^2} - \frac{c}{a}
2
x2+bax+b24a2=b24ac4a2x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} = \frac{b^2 - 4ac}{4a^2}

Expected Result: ✅ EQUIV

Step 5b: Factor the Left Side as a Perfect Square

Factor as Perfect Square

The left side is a perfect square trinomial

Not Verified
Assumptions: a != 0
1
x2+bax+b24a2=b24ac4a2x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} = \frac{b^2 - 4ac}{4a^2}
2
(x+b2a)2=b24ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}

Expected Result: ✅ EQUIV

Step 6: Take the Square Root of Both Sides

This is a critical step. We must use ± to capture both solutions:

Take Square Root

Using ± to preserve both solutions

Not Verified
Assumptions: a != 0
1
(x+b2a)2=b24ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}
2
x+b2a=±b24ac2ax + \frac{b}{2a} = \pm \frac{\sqrt{b^2 - 4ac}}{2a}

Expected Result: ✅ EQUIV (the ± captures both solutions)

What Happens Without ±
If we wrote x + b/(2a) = sqrt(b² - 4ac)/(2a) (without ±), the CAS would return NARROWS because we'd lose one solution.

Step 7: Solve for x

Solve for x

The final step - isolating x

Not Verified
Assumptions: a != 0
1
x+b2a=±b24ac2ax + \frac{b}{2a} = \pm \frac{\sqrt{b^2 - 4ac}}{2a}
2
x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Expected Result: ✅ EQUIV — We've derived the quadratic formula!

Full Derivation Chain

Here's the complete derivation verified in one block:

Complete Quadratic Formula Derivation

All steps verified together

Not Verified
Assumptions: a != 0
1
ax2+bx+c=0ax^2 + bx + c = 0
2
ax2+bx=cax^2 + bx = -c
3
x2+bax=cax^2 + \frac{b}{a}x = -\frac{c}{a}
4
x2+bax+b24a2=b24ac4a2x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} = \frac{b^2 - 4ac}{4a^2}
5
(x+b2a)2=b24ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}
6
x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Expected Result: ✅ EQUIV for all steps

Demonstrating NARROWS and WIDENS

The mode=solve feature can detect when derivation steps lose or introduce solutions.

Example: NARROWS (Lost Solutions)

When we take a square root without ±, we lose solutions:

Lost Solutions Example

Taking square root without ± loses the negative solution

Not Verified
1
x2=4x^2 = 4
2
x=2x = 2

Expected Result: ⚠️ NARROWS — The first equation has solutions {-2, 2}, but the second only has {2}. We lost the x = -2 solution.

Example: WIDENS (Extraneous Solutions)

When we square both sides, we can introduce extraneous solutions:

Extraneous Solutions Example

Squaring both sides introduces an extra solution

Not Verified
1
x=2x = 2
2
x2=4x^2 = 4

Expected Result: ⚠️ WIDENS — The first equation has solution {2}, but the second has {-2, 2}. We added the extraneous solution x = -2.

Example: Correct Use of ±

Using ± preserves the solution set:

Preserving Solutions with ±

Using ± keeps both solutions

Not Verified
1
x2=4x^2 = 4
2
x=±2x = \pm 2

Expected Result: ✅ EQUIV — Both equations have the same solution set {-2, 2}.

Domain Options

The domain attribute specifies where to look for solutions:

DomainDescriptionExample
R (default)Real numbersx² = 4 → {-2, 2}
CComplex numbersx² = -1 → {i, -i}
ZIntegers2x = 4 → {2}
NNatural numbersx = 2 → {2}

Example: Complex Domain

Complex Domain Example

Finding solutions in the complex numbers

Not Verified
1
x2=1x^2 = -1
2
x2+1=0x^2 + 1 = 0

Expected Result: ✅ EQUIV — Both have solutions {i, -i} in the complex domain.

When to Use Each Mode

ScenarioModeReason
Verify identity: sin²(x) + cos²(x) = 1equivalenceExpression identity
Factor: x² - 1 = (x-1)(x+1)chainExpression rewrite
Simplify: (x²-1)/(x-1) = x+1chainAlgebraic simplification
Solve: ax² + bx + c = 0 → quadratic formulasolveEquation derivation
Isolate variable: 2x + 3 = 7 → x = 2solveSolution-set transformation

Status Indicators for mode=solve

StatusMeaningExample
✅ EQUIVSame solution set (valid transformation)2x = 4 → x = 2
⚠️ NARROWSLost solutions (e.g., forgot ± when taking square root)x² = 4 → x = 2
⚠️ WIDENSExtraneous solutions (e.g., squared both sides)x = 2 → x² = 4
❓ UNKNOWNCannot determine relationshipComplex expressions
❌ ERRORParse or solve failedInvalid LaTeX

Multiple Solutions Syntax

Use \pm or \text{or} to express multiple solutions:

Multiple Solutions Syntax

Two ways to express multiple solutions

Using ±: x=±2x = \pm 2x=±2

Using "or": x=2orx=2x = 2 \,\,\text{or}\,\, x = -2x=2orx=2

Both are equivalent to the solution set {-2, 2}.

Best Practices

Always Use mode=solve for Equation Derivations
When your derivation involves dividing both sides, taking roots, or any operation that might change the solution set, use mode=solve.
Include the a ≠ 0 Assumption
For the quadratic formula derivation, always include assumptions="a != 0" since we divide by a.
Use ± When Taking Square Roots
Always use \pm when taking square roots of both sides to preserve all solutions. The CAS will warn you with NARROWS if you forget.
Specify the Solve Variable
Use solve_var=x to explicitly tell the CAS which variable you're solving for. This helps when you have multiple variables like a, b, c, and x.

Next Steps

Now that you understand mode=solve, explore more CAS verification examples in the CAS Verification Demo, which covers mode=equivalence and mode=chain for expression verification.

Related Content

Ready to Start?

Start creating beautiful technical documentation with AutEng.

Get Started with AutEng