Quadratic equations

A quadratic equation in ${x}$ is an equation that can be written as

${ax^2+bx+c=0}$,   with ${a\ne 0}$.

This is called the standard form. The ${x^2}$ term is what makes the equation quadratic. A quadratic equation can have two, one, or no real solutions.

There are four ways to solve a quadratic equation: factoring, square roots, completing the square, and the quadratic formula. This page shows each one, and when to use it.

Solving by factoring

Factoring works because of the zero-factor property:

If ${AB=0}$, then ${A=0}$ or ${B=0}$.

In words: if a product is ${0}$, at least one of its factors is ${0}$. So:

  1. Write the equation in standard form, with ${0}$ on one side.
  2. Factor the other side.
  3. Set each factor equal to ${0}$, and solve.

Example 1: Solve each equation.

(a) ${2x^2+5x=3}$

(b) ${x^2=3x}$

Solution:

(a) Subtract ${3}$ from both sides to get ${0}$ on the right. Then factor (by the ${ac}$ method):

$\begin{align*}2x^2+5x-3&=0\\(2x-1)(x+3)&=0\end{align*}$

Set each factor equal to ${0}$:

${2x-1=0}$   or   ${x+3=0}$

So ${x=\dfrac{1}{2}}$ or ${x=-3}$.

(b) Move everything to one side, and take out the common factor ${x}$:

$\begin{align*}x^2-3x&=0\\x(x-3)&=0\end{align*}$

So ${x=0}$ or ${x=3}$.

Watch out: do not divide both sides of ${x^2=3x}$ by ${x}$. That gives only ${x=3}$, and loses the solution ${x=0}$. Never divide by an expression that could be ${0}$.

The square root property

If an equation has the form ${x^2=k}$ with ${k>0}$, then ${x}$ is a square root of ${k}$. There are two:

If ${x^2=k}$, then ${x=\sqrt{k}}$ or ${x=-\sqrt{k}}$.

We write this in short as ${x=\pm\sqrt{k}}$, read "plus or minus the square root of ${k}$." The same idea works for a squared expression, such as ${(x-3)^2=7}$.

Example 2: Solve each equation.

(a) ${4x^2=25}$

(b) ${(x-3)^2=7}$

Solution:

(a) Get ${x^2}$ alone, then take square roots. Keep both signs:

$\begin{align*}x^2&=\dfrac{25}{4}\\x&=\pm\dfrac{5}{2}\end{align*}$

(b) Take square roots of both sides. Then add ${3}$:

$\begin{align*}x-3&=\pm\sqrt{7}\\x&=3\pm\sqrt{7}\end{align*}$

So the solutions are ${3+\sqrt{7}}$ and ${3-\sqrt{7}}$.

Completing the square

Example 2(b) was easy because the left side was already a square. Completing the square turns any quadratic into that form. It uses the perfect square pattern from polynomials and factoring:

$x^2+bx+\left(\dfrac{b}{2}\right)^2=\left(x+\dfrac{b}{2}\right)^2$

So to make ${x^2+bx}$ a perfect square, add ${\left(\dfrac{b}{2}\right)^2}$: half the coefficient of ${x}$, squared.

To solve ${ax^2+bx+c=0}$ by completing the square:

  1. If ${a\ne 1}$, divide both sides by ${a}$.
  2. Move the constant term to the right side.
  3. Add ${\left(\dfrac{b}{2}\right)^2}$ to both sides.
  4. Write the left side as a square, and use the square root property.

Example 3: Solve ${x^2+6x-2=0}$ by completing the square.

Solution:

Move the constant to the right side:

${x^2+6x=2}$

Half of ${6}$ is ${3}$, and ${3^2=9}$. Add ${9}$ to both sides:

$\begin{align*}x^2+6x+9&=2+9\\(x+3)^2&=11\end{align*}$

Take square roots, then subtract ${3}$:

$\begin{align*}x+3&=\pm\sqrt{11}\\x&=-3\pm\sqrt{11}\end{align*}$

The quadratic formula

The quadratic formula solves every quadratic equation. The solutions of ${ax^2+bx+c=0}$, with ${a\ne 0}$, are

${x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}}$.

To use it, first write the equation in standard form. Then read off ${a}$, ${b}$, and ${c}$, with their signs.

Optional

Where the formula comes from. Complete the square in ${ax^2+bx+c=0}$. Divide by ${a}$, and move the constant:

${x^2+\dfrac{b}{a}x=-\dfrac{c}{a}}$

Add $\left(\dfrac{b}{2a}\right)^2=\dfrac{b^2}{4a^2}$ to both sides. The right side gets the common denominator ${4a^2}$:

$\begin{align*}\left(x+\dfrac{b}{2a}\right)^2&=\dfrac{b^2}{4a^2}-\dfrac{c}{a}\\&=\dfrac{b^2-4ac}{4a^2}\end{align*}$

Take square roots. Since ${\sqrt{4a^2}=2|a|}$ and we have ${\pm}$ anyway, write it as ${2a}$:

$x+\dfrac{b}{2a}=\pm\dfrac{\sqrt{b^2-4ac}}{2a}$

Subtract ${\dfrac{b}{2a}}$ from both sides. This gives the quadratic formula.

Example 4: Solve ${3x^2-4x-2=0}$.

Solution:

This does not factor nicely, so use the formula. Here

${a=3,\quad b=-4,\quad c=-2}$.

Put the values into the formula:

$\begin{align*}&x\\&=\dfrac{-(-4)\pm\sqrt{(-4)^2-4(3)(-2)}}{2(3)}\\&=\dfrac{4\pm\sqrt{16+24}}{6}\\&=\dfrac{4\pm\sqrt{40}}{6}\end{align*}$

Simplify the radical: ${\sqrt{40}=\sqrt{4}\,\sqrt{10}=2\sqrt{10}}$. Then divide every term by ${2}$:

$\begin{align*}&x\\&=\dfrac{4\pm 2\sqrt{10}}{6}\\&=\dfrac{2\pm\sqrt{10}}{3}\end{align*}$

As decimals, the solutions are about ${1.72}$ and ${-0.39}$.

The discriminant

The expression under the square root, ${b^2-4ac}$, is called the discriminant. It tells how many real solutions there are, without solving:

DiscriminantReal solutions
${b^2-4ac>0}$two different real solutions
${b^2-4ac=0}$one real solution (a double root)
${b^2-4ac<0}$no real solutions

When the discriminant is negative, the square root of a negative number appears. That is not a real number. We will give these solutions a meaning on the next page, complex numbers.

Example 5: Use the discriminant to find the number of real solutions.

(a) ${2x^2-x-5=0}$

(b) ${4x^2-12x+9=0}$

(c) ${x^2+x+1=0}$

Solution:

(a) Here ${a=2}$, ${b=-1}$, ${c=-5}$:

$\begin{align*}&b^2-4ac\\&=(-1)^2-4(2)(-5)\\&=1+40=41\end{align*}$

This is positive, so there are two real solutions.

(b) Here ${a=4}$, ${b=-12}$, ${c=9}$:

$\begin{align*}&b^2-4ac\\&=(-12)^2-4(4)(9)\\&=144-144=0\end{align*}$

So there is one real solution. (In fact, ${4x^2-12x+9=(2x-3)^2}$.)

(c) Here ${a=1}$, ${b=1}$, ${c=1}$:

$\begin{align*}&b^2-4ac\\&=1^2-4(1)(1)\\&=-3\end{align*}$

This is negative, so there are no real solutions.

Which method should I use?

Applications

Example 6: A rectangular garden is ${4}$ m longer than it is wide. Its area is ${96\ \text{m}^2}$. Find its width and length.

Solution:

Let ${w}$ be the width, in meters. Then the length is ${w+4}$. The area is length times width:

$\begin{align*}w(w+4)&=96\\w^2+4w-96&=0\\(w+12)(w-8)&=0\end{align*}$

So ${w=-12}$ or ${w=8}$. A width cannot be negative, so ${w=8}$.

The garden is ${8}$ m wide and ${8+4=12}$ m long. Check: ${8\cdot 12=96}$.

Example 7: A ball is thrown straight up from the edge of a cliff, ${20}$ m above the sea. Its height above the sea after ${t}$ seconds is

${h=-4.9t^2+15t+20}$ meters.

When does the ball hit the water?

Solution:

At the start (${t=0}$), the height is ${20}$ m: the top of the cliff. The ball goes up, slows down, and then falls past the cliff into the sea. When it hits the water, its height above the sea is ${0}$.

To find the time, set ${h=0}$, and solve for ${t}$:

${-4.9t^2+15t+20=0}$

This is a quadratic equation with

${a=-4.9,\quad b=15,\quad c=20}$.

Use the quadratic formula:

$\begin{align*}&t\\&=\dfrac{-15\pm\sqrt{15^2-4(-4.9)(20)}}{2(-4.9)}\\&=\dfrac{-15\pm\sqrt{225+392}}{-9.8}\\&=\dfrac{-15\pm\sqrt{617}}{-9.8}\\&\approx\dfrac{-15\pm 24.84}{-9.8}\end{align*}$

The ${\pm}$ sign gives two times.

First, with ${+}$:

$\begin{align*}t&\approx\dfrac{-15+24.84}{-9.8}\\&=\dfrac{9.84}{-9.8}\\&\approx -1.00\ \text{s}\end{align*}$

Next, with ${-}$:

$\begin{align*}t&\approx\dfrac{-15-24.84}{-9.8}\\&=\dfrac{-39.84}{-9.8}\\&\approx 4.07\ \text{s}\end{align*}$

The ball is thrown at ${t=0}$, so the time must be positive. The negative time is before the throw, so we drop it. The ball hits the water after about ${4.07}$ seconds.

Summary