Math Core

Lesson 9.6 · Quadratic Functions and Equations

The quadratic formula and the discriminant

Completing the square works on every quadratic, but it takes several steps each time. If you complete the square once on the general equation ax2+bx+c=0ax^2 + bx + c = 0, you get a formula that solves any quadratic just by substituting aa, bb and cc. A small piece of that formula, the discriminant, even tells you how many solutions to expect before you find them.

Where the formula comes from

Follow the same steps as in the last lesson, but with letters instead of numbers. Start with ax2+bx+c=0ax^2 + bx + c = 0, where a≠0a \ne 0.

x2+bax=−cadivide by a, move the constantx2+bax+b24a2=b24a2−caadd (b2a)2 to both sides(x+b2a)2=b2−4ac4a2common denominator on the rightx+b2a=±b2−4ac2asquare rootsx=−b±b2−4ac2a\begin{aligned} x^2 + \frac{b}{a}x &= -\frac{c}{a} && \text{divide by } a \text{, move the constant} \\ x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} &= \frac{b^2}{4a^2} - \frac{c}{a} && \text{add } \left(\tfrac{b}{2a}\right)^2 \text{ to both sides} \\ \left(x + \frac{b}{2a}\right)^2 &= \frac{b^2 - 4ac}{4a^2} && \text{common denominator on the right} \\ x + \frac{b}{2a} &= \pm\frac{\sqrt{b^2 - 4ac}}{2a} && \text{square roots} \\ x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \end{aligned}

You don't need to reproduce this every time, but it shows why the formula is true: it is just completing the square, done once and for all.

The quadratic formula

The solutions of ax2+bx+c=0ax^2 + bx + c = 0, where a≠0a \ne 0, are

x=−b±b2−4ac2a.x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

The equation must be in standard form (equal to 00) before you read off aa, bb and cc.

Worked example: Rational solutions

Solve x2−3x−10=0x^2 - 3x - 10 = 0 with the quadratic formula.

Here a=1a = 1, b=−3b = -3 and c=−10c = -10. First compute the part under the radical:

b2−4ac=(−3)2−4(1)(−10)=9+40=49.b^2 - 4ac = (-3)^2 - 4(1)(-10) = 9 + 40 = 49.

Then

x=−(−3)±492(1)=3±72.x = \frac{-(-3) \pm \sqrt{49}}{2(1)} = \frac{3 \pm 7}{2}.

So x=102=5x = \dfrac{10}{2} = 5 or x=−42=−2x = \dfrac{-4}{2} = -2. (Factoring as (x−5)(x+2)(x - 5)(x + 2) gives the same answers.)

Worked example: Irrational solutions

Solve 2x2+4x−3=02x^2 + 4x - 3 = 0.

Here a=2a = 2, b=4b = 4, c=−3c = -3, and b2−4ac=16−4(2)(−3)=16+24=40b^2 - 4ac = 16 - 4(2)(-3) = 16 + 24 = 40.

x=−4±404=−4±2104=−2±102.x = \frac{-4 \pm \sqrt{40}}{4} = \frac{-4 \pm 2\sqrt{10}}{4} = \frac{-2 \pm \sqrt{10}}{2}.

The last step divides every term of the numerator and the denominator by 22. The solutions are about 0.580.58 and −2.58-2.58.

Common mistake

Watch the signs, especially when bb is negative.

  • −b-b means "the opposite of bb." If b=−3b = -3, then −b=3-b = 3.
  • b2b^2 is never negative: (−3)2=9(-3)^2 = 9, not −9-9. Use parentheses when you substitute.
  • The fraction bar goes under the whole numerator, −b±b2−4ac-b \pm \sqrt{b^2 - 4ac}, not just the square root. When you simplify, divide every term by the same number.

The discriminant

The expression under the square root decides what kind of solutions you get.

Definition

Discriminant

The discriminant of ax2+bx+c=0ax^2 + bx + c = 0 is D=b2−4acD = b^2 - 4ac.

  • If D>0D > 0, there are two real solutions (−b+D-b + \sqrt{D} and −b−D-b - \sqrt{D} are different).
  • If D=0D = 0, there is exactly one real solution, x=−b2ax = -\dfrac{b}{2a} (adding or subtracting 00 gives the same number).
  • If D<0D < 0, there are no real solutions (a negative number has no real square root).

Graphically, the discriminant counts the x-intercepts of y=ax2+bx+cy = ax^2 + bx + c.

y = x² - 4 (D = 16) crosses the x-axis twice at -2 and 2. y = x² (D = 0) touches it once at its vertex. y = x² + 3 (D = -12) never reaches it.Open in grapher →

When DD is a perfect square (0,1,4,9,16,…0, 1, 4, 9, 16, \ldots), the solutions are rational and the quadratic can be factored over the integers. When DD is positive but not a perfect square, the solutions are irrational.

Worked example: Counting solutions

Use the discriminant to find the number of real solutions.

  1. 3x2−5x+4=03x^2 - 5x + 4 = 0
  2. 4x2+12x+9=04x^2 + 12x + 9 = 0
  3. x2+x−1=0x^2 + x - 1 = 0

Solutions.

  1. D=(−5)2−4(3)(4)=25−48=−23D = (-5)^2 - 4(3)(4) = 25 - 48 = -23. Negative, so no real solutions.
  2. D=122−4(4)(9)=144−144=0D = 12^2 - 4(4)(9) = 144 - 144 = 0. Exactly one solution. (Indeed, 4x2+12x+9=(2x+3)24x^2 + 12x + 9 = (2x + 3)^2.)
  3. D=12−4(1)(−1)=1+4=5D = 1^2 - 4(1)(-1) = 1 + 4 = 5. Positive, so two solutions, and since 55 isn't a perfect square they are irrational.

Choosing a method

You now have four ways to solve a quadratic equation. All of them give the same answers, so choose the quickest.

the equation looks likegood method
no xx term, or (x−h)2=d(x - h)^2 = dsquare roots
a trinomial that factors easilyfactoring
a=1a = 1 and bb is evencompleting the square
anything elsethe quadratic formula

Tip

The quadratic formula always works, so it's the safe choice when you don't spot a factorization within a few seconds. Computing DD first is a good habit: if D<0D < 0 you can stop, and if DD is a perfect square you know factoring would have worked too.

Worked example: A throw that never reaches 35 feet

A ball is thrown upward, and its height in feet after tt seconds is h(t)=−16t2+40t+5h(t) = -16t^2 + 40t + 5.

When does it land? Set h(t)=0h(t) = 0 and multiply by −1-1: 16t2−40t−5=016t^2 - 40t - 5 = 0. Then D=(−40)2−4(16)(−5)=1600+320=1920D = (-40)^2 - 4(16)(-5) = 1600 + 320 = 1920, and

t=40±192032≈40±43.8232.t = \frac{40 \pm \sqrt{1920}}{32} \approx \frac{40 \pm 43.82}{32}.

The solutions are about 2.622.62 and −0.12-0.12. Time can't be negative, so the ball lands after about 2.622.62 seconds.

Does it ever reach 3535 feet? Set h(t)=35h(t) = 35: −16t2+40t−30=0-16t^2 + 40t - 30 = 0, or 16t2−40t+30=016t^2 - 40t + 30 = 0. The discriminant is 1600−4(16)(30)=1600−1920=−3201600 - 4(16)(30) = 1600 - 1920 = -320. It's negative, so there is no solution: the ball never gets that high. (Its vertex is at t=1.25t = 1.25, where h=30h = 30 feet.)

Practice

Practice 1

Solve 2x2−7x+3=02x^2 - 7x + 3 = 0 using the quadratic formula.

Separate answers with commas, e.g. 2, -5

Practice 2

Find the discriminant of 3x2−4x−2=03x^2 - 4x - 2 = 0.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

How many real solutions does 5x2−2x+1=05x^2 - 2x + 1 = 0 have?

Practice 4

Solve x2−6x+4=0x^2 - 6x + 4 = 0.

Practice 5

Solve 3x2+2x−2=03x^2 + 2x - 2 = 0. What is the larger solution? Give an exact answer, such as (2 + sqrt(3))/5.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

For what positive value of kk does x2+kx+16=0x^2 + kx + 16 = 0 have exactly one solution?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Solve x2+4x−7=0x^2 + 4x - 7 = 0. Round each solution to the nearest hundredth.

Separate answers with commas, e.g. 2, -5

Practice 8

A ball's height in feet after tt seconds is h(t)=−16t2+24t+6h(t) = -16t^2 + 24t + 6. After how many seconds does it hit the ground? Round to the nearest hundredth.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.