#### xaktly | Algebra | Functions

{ factoring } Quadratic functions are very important.* There's a lot to cover, so the material is broken up into a few sections.

• This section covers all methods of solving quadratic equations.
• Quadratic functions deals with definitions, graphing and transformations of the parabola, the graph of a quadratic function.
• This page specifically on the very important completing the square technique has a generator to create random quadratic equations that you can try to solve. You can reveal a step-by-step guide to each solution.
• Quadratic problems covers various kinds of problems you can solve using quadratic functions.
• You should also check out the Po-Shen Loh method (new in 2019) at the bottom of this page. It's pretty cool, simple to use, and foolproof!

* I can't overemphasize how important it is to master quadratic functions if you intend to go further with your studies of mathematics. Because all things in math are more the same than different, the things you learn in these sections, with a relatively easy function type, will be valuable later. Beyond that, it's often possible to reduce a more complicated problem to a quadratic one. Quadratic relationships are all over. Learn all about them!

### The algebra of solving quadratic equations

We are often faced with finding the solution to the equation $f(x) = k,$ where $k$ is some constant. For example, we might want to solve the quadratic equation

$$3x^2 - 4x - 12 = 5$$

But an equation like this can always be rewritten by moving everything to the left side (leaving a zero on the right):

$$3x^2 - 4x - 17 = 0$$

Now we're just finding the x-intercepts (also called roots or zeros), which can be done by direct factoring (we do this "by eye" from experience at recognizing patterns), by completing the square, or by using the quadratic formula. The latter two actually turn out to be the same thing, as we'll see. We'll develop both of these techniques below.

The fundamental theorem of algebra tells us that any polynomial equation of degree n has exactly n solutions, though some might be imaginary.

So a quadratic function (degree = 2) will always have two solutions. There are three possibilities for those solutions, illustrated in graphs below. The solutions to a quadratic equation,

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

can be

• Two real roots, indicating that the parabola (graph of a quadratic) intersects the x-axis twice,
• One real root, actually a double root, indicating that the vertex of the parabola just touches (is tangent to) the x-axis, or
• Two imaginary roots, in a pair of complex conjugates, like $a ± ib,$ where $a$ is the real part of the solutions and ib is the imaginary part ($i$ is the imaginary number $i = \sqrt{-1}.$ You might want to review complex numbers if you need some brushing up.

The figures below illustrate these possibilities graphically.   ### What it means to factor "directly"

We think of direct factoring as finding binomial factors of a quadratic function "by eye" or "by instinct," or by the guess-and-check method. Whatever you call it, if it's possible, direct factoring is a quick way to the roots of a quadratic function.

#### Direct factoring: A = 1

\begin{align} f(x) &= (x + m)(x + n) \\[5pt] &= x^2 + mx + nx + mn \\[5pt] &= x^2 + (m + n)x + mn, \end{align}

which looks like   $Ax^2 + Bx + C,$   with $A = 1.$ Notice the correspondence:   $A = 1, \; B = m+n,$ and $C = mn.$

\begin{align} f &= (x + m)(x + n) \\[5pt] &= x^2 + mx + nx + mn \\[5pt] &= x^2 + \color{#A7D82F}{(m + n)}x + \color{#00B0FF}{mn} \\[5pt] &\phantom{00} \updownarrow \phantom{0000} \updownarrow \phantom{000000} \updownarrow \\[5pt] f(x) &= \color{#E90F89}{A}x^2 + \: \color{#A7D82F}{B}x \phantom{00} + \phantom{0} \color{#00B0FF}{C} \\[5pt] \end{align}

$$\color{#E90F89}{A} = 1 \phantom{000} \color{#A7D82F}{B} = \color{#A7D82F}{m + n} \phantom{000} \color{#00B0FF}{C} = \color{#00B0FF}{mn}$$

From this relation, you can easily see that what we're looking for in direct factoring is two numbers, m and n, that add to B and multiply to C.

The trick is to get good at recognizing patterns that lead us to proper factoring. That comes through practice - although on rare occasions, I've met people who are factoring savants.

#### Direct factoring: A ≠ 1

Direct factoring when A ≠ 1 is a little trickier, but you can still learn to recognize the patterns:

\begin{align} f(x) &= (ax + m)(bx + n) \\[5pt] &= ab \, x^2 + (mb + na)x + mn. \end{align}

Here is a complete picture of the correspondence between the parameters A, B & C and a, b, m & n:

\begin{align} f &= (ax + m)(bx + n) \\[5pt] &= abx^2 + anx + bmx + mn \\[5pt] &= \color{#E90F89}{ab}x^2 + \color{#A7D82F}{(bm + an)}x + \color{#00B0FF}{mn} \\[5pt] &\phantom{00} \updownarrow \phantom{0000000} \updownarrow \phantom{000000} \updownarrow \\[5pt] f(x) &= \color{#E90F89}{A}x^2 + \phantom{000} \color{#A7D82F}{B}x \phantom{00} + \phantom{0} \color{#00B0FF}{C} \\[5pt] \end{align}

$$\color{#E90F89}{A} = \color{#E90F89}{ab} \phantom{000} \color{#A7D82F}{B} = \color{#A7D82F}{bm + an} \phantom{000} \color{#00B0FF}{C} = \color{#00B0FF}{mn}$$

Now a·b must multiply to A, bm+an must sum to B and mn must multiply to C. Honestly, though, I never think of it this way; I factor this kind of quadratic equation by "educated trial and error."

#### An interesting thing about direct factoring

Here's an interesting note on direct factoring. I once made a spreadsheet of quadratic functions with coefficients A= -9, B= -9, C= -9; A= -9, B =-9, C= -8; ... up to A= 9, B= 9, C= 9. Of over 5000 possible quadratic equations that were generated in this way, only about 12% were directly factorable. As you work out in the world, not only is it unlikely that you'll encounter a factorable quadratic equation, but it's even less likely you'll encounter one with nice integer coefficients!

#### Why learn to factor? So of what value is direct factoring? Well, it's always good to be able to recognize patterns in mathematics, and factoring practice helps with that. It also helps us to arrive rapidly at exact solutions for many equations. But we'll want a more general way of solving quadratic equations, and that's completing the square.

### Practice – Direct factoring

Solve these quadratic equations (find their roots or zeros) by direct factoring.

 1 $x^2 - 2x - 3 = 0$ Solution $= (x + 1)(x - 3)$ $x = -1, \; 3$ 2 $x^2 + 7x + 10 = 0$ Solution $= (x + 2)(x + 5)$ $x = -5, \; -2$ 3 $x^2 - 5x - 66 = 0$ Solution $= (x -11)(x + 6)$ $x = -6, \; 11$ 4 $x^2 - 9x + 20 = 0$ Solution $= (x - 4)(x - 5)$ $x = 4, \; 5$ 5 $x^2 - 4 = 0$ Solution $= (x - 2)(x + 2)$ $x = ±2$ 6 $x^2 + 26x + 169 = 0$ Solution $= (x + 13)(x + 13)$ $x = -13, \; -13$ 7 $x^2 - 6x + 9 = 0$ Solution $= (x - 3)(x - 3)$ $x = 3, \; 3$ 8 $2x^2 - 3x - 2 = 0$ Solution $= (2x + 1)(x - 2)$ $x = -\frac{1}{2}, \; 2$ 9 $2x^2 + 5x - 3 = 0$ Solution $= (2x - 1)(x + 3)$ $x = \frac{1}{2}, \; -3$ 10 $4x^2 + 4x + 1 = 0$ Solution $= (2x + 1)(2x + 1)$ $x = -\frac{1}{2}, \; -\frac{1}{2}$

 11 $2x^2 - 2x - 12 = 0$ Solution $= (2x + 3)(x - 4)$ $x = -\frac{3}{2}, \; 4$ 12 $10x^2 - x - 3 = 0$ Solution $= (5x - 3)(2x + 1)$ $x = \frac{3}{5}, \; -\frac{1}{2}$ 13 $16x^2 - 1 = 0$ Solution $= (4x - 1)(4x + 1)$ $x = ±\frac{1}{4}$ 14 $11x^2 + 13x + 2 = 0$ Solution $= (11x + 2)(x + 1)$ $x = -\frac{2}{11}, \; -1$ 15 $5x^2 - 5 = 0$ Solution $= 5(x^2 - 1)$ $= 5(x - 1)(x + 1)$ $x = ±1$ 16 $7x^2 - 8x + 1 = 0$ Solution $= (7x - 1)(x - 1)$ $x = \frac{1}{7}, \; 1$ 17 $9x^2 - 6x + 1 = 0$ Solution $= (3x - 1)(3x - 1)$ $x = \frac{1}{3}, \; \frac{1}{3}$ 18 $9x^2 + 9x + 2 = 0$ Solution $= (3x + 1)(3x + 2)$ $x = -\frac{1}{3}, \; -\frac{2}{3}$ 19 $18x^2 + 9x - 2 = 0$ Solution $= (6x - 1)(3x + 2)$ $x = \frac{1}{6}, \; -\frac{2}{3}$ 20 $12x^2 + 23x + 11 = 0$ Solution $= (12x + 11)(x + 1)$ $x = -\frac{11}{12}, \; -1$

### Completing the square

The most general method of finding the solutions to $Ax^2 + Bx + C = 0$ is the method called completing the square. It works like this: Take any binomial and square it, $(x + m)^2,$ to form a perfect square. Then expand it:

$$(x + m)^2 = x^2 + 2mx + m^2$$

Now notice that for a perfect square, the constant term is equal to the square of one-half of the coefficient of x:

$$\require{cancel} m^2 = \left[ \frac{1}{\cancel{2}} (\cancel{2}m) \right]^2$$

We can use this to our advantage. We can build a perfect square out of any quadratic function, but at the expense of accumulating some constants on the right side of the equation. But that's OK, we can easily deal with that later. Below are a few step-by-step examples of completing the square. We use the same basic steps each time, and you should learn them.

Completing the square is basically forcing part of a quadratic equation (the part with the variables) to be a perfect square with a well known pattern. The cost of this is accumulating constants on the other side of the equation, but we can always deal with the at the end.

##### Enter A, B, C & hit [Calculate]
A
B
C Root 1
Root 2
Discriminant
Vertex

Here is a little quadratic solver tool that you can use to find the roots of any quadratic equation numerically. It might help you to solve the problems on this page. It will calculate roots (real or imaginary), the vertex coordinates and the discriminant of any quadratic function.

Just enter the A, B and C constants and hit calculate.

### Example 1

Solve   x2 + 2x - 35 = 0

Solution: You should first notice that this function is factorable:   f(x) = (x + 7)(x - 5), so we really already know the solutions: both x = -7 and x = 5 make this equation equal to zero. But let's solve this problem by completing the square to see if we can get to these solutions in that way.

We'll do these problems using the same steps each time. The first is

##### 1. Move the constant to the right.

We begin with our function, and move the constant to the right side, in this case by addition of 35 to each side:

$$x^2 + 2x = 35$$

##### 2. Ensure that the coefficient of x2 is one.

We divide by the coefficient of $x^2$ to make it 1. In this case, it's already 1, so we move on ...

##### 3. Add the square of ½ of the coefficient of x to both sides (complete the square).

This is the key step. One half of 2 is 1, so we'll add 1 to both sides. I like to write the number added to the left as 12 (of course when it's 1 it doesn't make much difference, but it will later), and just go ahead and square it on the right. Now we've made a perfect square on the left.

$$x^2 + 2x + 1^2 = 35 + 1$$

##### 4. Identify the perfect square.

Now we've constructed a perfect square on the left. That's what we set out to do. The "cost" was that we had to add that 1 to the right side. Now our equation is

$$\color{#E90F89}{x}^2 \color{#E90F89}{+} 2x + \color{#E90F89}{1}^2 = 36$$

The magenta items are a consistent pattern for how to identify the perfect square in all of these problems: Take the x, the first operation (+ in this case) and the number that's 1/2 of the coefficient of x – before it's squared. The perfect-square equation is:

$$(x + 1)^2 = 36$$

##### 5. Take the square root of both sides.

Now it's easy to solve for x, simply take the square root of each side, remembering to append a ± to the right side (it could go on either side, but there works best).

$$x + 1 = ±\sqrt{36}$$

Now it's a simple matter to find the two solutions, and you can see that they match our original solutions that came from factoring.

\begin{align} x &= -1 ± 6 \\[5pt] x &= -7, \; 5 \end{align}

### Example 2

Solve   2x2 + 2x - 11 = 0

Solution: This function is not factorable, so it will be a true test of completing the square. Also, A ≠ 1 in this equation, so we can see the whole scope of how to use the method.

We begin with our function and walk through the steps:

$$f(x) = 2x^2 + 2x - 11 = 0$$

##### 1. Move the constant to the right.

$$2x^2 + 2x = 11$$

##### 2. Ensure that the coefficient of x2 is one.

We divide by the coefficient of x2 , 2 in this case:

$$x^2 + x = \frac{11}{2}$$

##### 3. Add the square of 1/2 of the coefficient of x to both sides (complete the square).

One half of 1 is ½, so we'll add the square of ½ to both sides, again writing it as (½)2 on the left, and ¼ on the right. Doing so really helps to properly identify the perfect square on the left in the next step.

$$\color{#E90F89}{x}^2 \color{#E90F89}{+} x + \left( \color{#E90F89}{\frac{1}{2}} \right)^2 = \frac{11}{2} + \frac{1}{4}$$

##### 4. Identify the perfect square.

The perfect square is composed of the x from x2, the sign following it ( + ) and the ½ from (½)2:

$$\left( x + \frac{1}{2} \right)^2 = \frac{23}{4}$$

##### 5. Take the square root of both sides.

Now it's easy to solve for x. Take the square root of each side, remembering to append a ± to the right side:

$$x + \frac{1}{2} = \frac{±\sqrt{23}}{2}$$

Now we just move that ½ to the right side by subtraction to get our two solutions:.

$$x = \frac{-1 ± \sqrt{23}}{2}$$

It is very unlikely that anyone would come up with these solutions by direct factoring!

### Example 3 – imaginary roots

Solve   2x2 + 5x + 4 = 0

Solution: This function is not factorable, and if you were to plot its graph, you'd find that it doesn't cross the x-axis. Therefore it has no real roots. Nevertheless, we can complete the square to find a pair of complex roots (or more precisely complex roots with nonzero imaginary parts).

If you haven't studied complex numbers yet, you might want to review them here.

##### 1. Move the constant to the right.

$$2x^2 + 5x = -4$$

##### 2. Ensure that the coefficient of x2 is one.

We divide by the coefficient of x2 , 2 in this case:

$$x^2 + \frac{5}{2} x = \frac{-4}{2}$$

##### 3. Add the square of 1/2 of the coefficient of x to both sides (complete the square).

One half of 5/2 is 5/4, so we'll add the square of 5/4 to both sides, again writing it as (5/4)2 on the left, and 25/16 on the right. Doing so really helps to properly identify the perfect square on the left in the next step.

$$x^2 + \frac{5}{2} x + \left( \frac{5}{4} \right)^2 = \frac{-4}{2} + \frac{25}{16}$$

##### 4. Identify the perfect square.

The perfect square is composed of the x from x2, the sign following it ( + ) and the 5/4 from (5/4)2. We can also add the fractions on the right by using 16 as a common denominator:

$$\left( x + \frac{5}{4} \right)^2 = \frac{-32 + 25}{16} = \frac{-7}{16}$$

##### 5. Take the square root of both sides.

Take the square root of each side, remembering to append a ± to the right side. Note that we're taking the square root of a negative number, so we'll need imaginary numbers:

$$\sqrt{\left( x + \frac{5}{4} \right)^2} = \sqrt{\frac{-7}{16}}$$

Taking the root and moving the 5/4 to the right by subtraction gives a pair of imaginary roots:

$$x = \frac{-5 ± i\sqrt{7}}{4}$$

### Example 4

Derivation of the quadratic formula by completing the square on x2 + Bx + C = 0

Finally, let's complete the square on a completely general (no numbers) quadratic equation, Ax2 + Bx + C = 0. You'll see why this is relevant when we're done.

##### 1. Move the constant to the right.

$$f(x) = Ax^2 + Bx + C = 0$$

##### 2. Divide by A to Ensure that the coefficient of x2 is one.

$$x^2 + \frac{B}{A} x = \frac{-C}{A}$$

##### 3. Add the square of 1/2 of the coefficient of x to both sides (complete the square).

One half of B/A is B/(2A), (and remember that the square of that is B2/(4A2) so we get:

$$x^2 + \frac{B}{A} x + \left( \frac{B}{2A} \right)^2 = \frac{-C}{A} + \frac{B^2}{4A^2}$$

##### 4. Identify the perfect square.

Here is the perfect square, and I've multiplied the -C/A term on the right by 4A/4A to get a common denominator to add those terms:

$$\left( x + \frac{B}{2A} \right)^2 = \frac{B^2 - 4AC}{4A^2}$$

##### 5. Take the square root of both sides.

Take the square root of each side, remembering to append a ± to the right side.

$$\sqrt{\left( x + \frac{B}{2A} \right)^2} = \sqrt{\frac{B^2 - 4AC}{4A^2}}$$

Now the 4A2 on the right side denominator is a square, so we can take its square root. Continuing the rearrangement by subtracting B/2A from both sides we arrive at:

$$x = \frac{-B ± \sqrt{B^2 - 4AC}}{2A}$$

which is the well-known quadratic formula. Yup, completing the square and using the quadratic formula are the same thing!

The quadratic formula gives the two zeros or roots of any quadratic equation,
Ax2 + Bx + C = 0
. It is:

#### Why complete the square? Why do I need to be able to complete the square when I can just use the quadratic formula? Over the years I've seen many, many mistakes made using the quadratic formula. I think it has to do with my students over-estimating how easy it is to use. But in fact, it's a little complicated, and all of the usual rules of algebra apply. For my part, I can complete the square as fast as anyone can use the quadratic, and I like the practice it gives me at adding fractions.

There are also situations you'll encounter later on, like when you study circles, ellipses and hyperbolas, where completing the square will help you immensely.

### The discriminant

#### a quick way to determine whether a quadratic function has real roots

There is a way to know fairly quickly whether the roots of a quadratic function are real: by calculating the discriminant. The discriminant is just the square root part of the quadratic formula, B2 - 4AC →.

We have to resort to imaginary numbers if the discriminant is negative, and if it's positive we're assured of real roots. Here are all of the options:

If B2 - 4AC > 0, the function has two real roots.

If B2 - 4AC = 0, there is one double root, and the vertex of the parabola touches the x-axis.

If B2 - 4AC < 0, there are two complex roots, a complex-conjugate pair.

If a function has a double root, it touches the x-axis at only one point, its vertex. The same is true for any polynomial function with a double root: It will only touch the axis (not cross) at that point. ### Practice problems

Find the solutions (roots, zeros) of these quadratic equations by completing the square. Some of the solutions may be imaginary.

 1 $x^2 - 3x - 3 = 0$ Solution \begin{align} x^2 - 3x &= 3 \\[5pt] x^2 - 3x + \left(\frac{3}{2}\right)^2 &= 3 + \frac{9}{4} \\[5pt] \left( x - \frac{3}{2} \right)^2 &= \frac{21}{4} \\[5pt] x &= \frac{3 ± \sqrt{21}}{2} \end{align} 2 $2x^2 + 5x + 4 = 0$ Solution \begin{align} 2x^2 + 5x &= -4 \\[5pt] x^2 + \frac{5}{2}x &= -2 \\[5pt] x^2 + \frac{5}{2}x + \left( \frac{5}{4} \right)^2 &= -2 + \frac{25}{16} \\[5pt] \left( x + \frac{5}{4} \right)^2 &= \frac{-32 + 25}{16} \\[5pt] \left( x + \frac{5}{4} \right)^2 &= \frac{-7}{16} \\[5pt] x &= \frac{-5 ± i\sqrt{7}}{4} \end{align} 3 $-3x^2 + 2x + 1 = 0$ Solution \begin{align} -3x^2 + 2x &= -1 \\[5pt] x^2 - \frac{2}{3} x &= \frac{1}{3} \\[5pt] x^2 - \frac{2}{3} x + \left( \frac{1}{3} \right)^2 &= \frac{1}{3} + \frac{1}{9} \\[5pt] \left( x - \frac{1}{3} \right)^2 &= \frac{4}{9} \\[5pt] x &= \frac{1 ± 2}{3} \\[5pt] x &= -\frac{2}{3}, \; 1 \end{align} 4 $-7x^2 + x + 14 = 0$ Solution \begin{align} -7x^2 + x &= -14 \\[5pt] x^2 - \frac{1}{7} x &= 2 \\[5pt] x^2 - \frac{1}{7}x + \left( \frac{1}{14} \right)^2 &= 2 + \frac{1}{196} \\[5pt] \left( x - \frac{1}{14} \right)^2 &= \frac{393}{196} \\[5pt] x &= \frac{1 ± \sqrt{393}}{14} \end{align} 5 $6x^2 + 3x + 7 = 0$ Solution \begin{align} 6x^2 + 3x &= -7 \\[5pt] x^2 + \frac{1}{2}x &= -\frac{7}{6} \\[5pt] x^2 + \frac{1}{2}x + \left( \frac{1}{4}\right)^2 &= \frac{1}{16} - \frac{7}{6} \\[5pt] \left( x + \frac{1}{4} \right)^2 &= \frac{6 - 112}{16} \\[5pt] \left( x + \frac{1}{4} \right)^2 &= \frac{-106}{16} \\[5pt] x &= \frac{-1 ± i \sqrt{106}}{4} \end{align} 6 $x^2 - x - 1 = 0$ Solution \begin{align} x^2 - x &= 1 \\[5pt] x^2 - x + \left( \frac{1}{2} \right)^2 &= 1 + \frac{1}{4} \\[5pt] \left( x - \frac{1}{2} \right)^2 &= \frac{5}{4} \\[5pt] x &= \frac{1 ± \sqrt{5}}{2} \end{align} 7 $x^2 + x + 1 = 0$ Solution \begin{align} x^2 + x &= -1 \\[5pt] x^2 + x + \left( \frac{1}{2} \right)^2 &= -1 + \frac{1}{4} \\[5pt] \left( x + \frac{1}{2} \right)^2 &= \frac{-3}{4} \\[5pt] x &= \frac{-1 ± i\sqrt{3}}{2} \end{align} 8 $2x^2 + 2x + 3 = 0$ Solution \begin{align} 2x^2 + 2x &= -3 \\[5pt] x^2 + x &= \frac{-3}{2} \\[5pt] x^2 + x + \left( \frac{1}{2} \right)^2 &= \frac{-3}{2} + \frac{1}{4} \\[5pt] \left( x + \frac{1}{2} \right)^2 &= \frac{-5}{4} \\[5pt] x &= \frac{-1 ± i \sqrt{5}}{2} \end{align} 9 $x^2 - 7x - 7 = 0$ Solution \begin{align} x^2 - 7x &= 7 \\[5pt] x^2 - 7x + \left( \frac{7}{2} \right)^2 &= 7 + \frac{49}{4} \\[5pt] \left( x - \frac{7}{2} \right)^2 &= \frac{28 + 49}{4} \\[5pt] x &= \frac{7 ± \sqrt{77}}{2} \end{align} 10 $x^2 + 2x - 9 = 0$ Solution \begin{align} x^2 + 2x &= 9 \\[5pt] x^2 + 2x + 1^2 &= 9 + 1 \\[5pt] (x + 1)^2 &= 10 \\[5pt] x &= -1 ± \sqrt{10} \end{align}

 11 $2x^2 - x - 2 = 0$ Solution \begin{align} 2x^2 - x &= 2 \\[5pt] x^2 - \frac{1}{2}x &= 1 \\[5pt] x^2 - \frac{1}{2}x + \left(\frac{1}{4}\right)^2 &= 1 + \frac{1}{16} \\[5pt] \left( x - \frac{1}{4}\right)^2 &= \frac{17}{16} \\[5pt] x &= \frac{1 ± \sqrt{17}}{4} \end{align} 12 $3x^2 + x + 1 = 0$ Solution \begin{align} 3x^2 + x &= -1 \\[5pt] x^2 + \frac{1}{3}x &= \frac{-1}{3} \\[5pt] x^2 + \frac{1}{3}x + \left(\frac{1}{6}\right)^2 &= \frac{-1}{3} + \frac{1}{36} \\[5pt] \left(x + \frac{1}{6}\right)^2 &= \frac{-11}{36} \\[5pt] x &= \frac{-1 ± i\sqrt{11}}{6} \end{align} 13 $x^2 - 5x - 25 = 0$ Solution \begin{align} x^2 - 5x &= 25 \\[5pt] x^2 - 5x + \left( \frac{5}{6}\right)^2 &= 25 + \frac{25}{4} \\[5pt] \left( x - \frac{5}{2} \right)^2 &= \frac{125}{4} \\[5pt] x &= \frac{5 ± \sqrt{125}}{2} \\[5pt] &= \frac{5 ± 5\sqrt{5}}{2} \end{align} 14 $-x^2 + 2x + 1 = 0$ Solution \begin{align} -x^2 + 2x &= -1 \\[5pt] x^2 - 2x &= 1 \\[5pt] x^2 - 2x + 1 &= 1 + 1 \\[5pt] (x - 1)^2 &= 2 \\[5pt] x &= 1 ± \sqrt{2} \end{align} 15 $-4x^2 - 4x + 4 = 0$ Solution \begin{align} -4x^2 - 4x &= -4 \\[5pt] x^2 + x &= 1 \\[5pt] x^2 + x + \left( \frac{1}{2} \right)^2 &= 1 + \frac{1}{4} \\[5pt] \left( x + \frac{1}{2} \right)^2 &= \frac{5}{4} \\[5pt] x &= \frac{-1 ± \sqrt{5}}{2} \end{align} 16 $7x^2 + 2x + 1 = 0$ Solution \begin{align} 7x^2 + 2x &= -1 \\[5pt] x^2 + \frac{2}{7}x &= \frac{-1}{7} \\[5pt] x^2 + \frac{2}{7}x + \left( \frac{1}{7}\right)^2 &= \frac{1}{49} - \frac{1}{7} \\[5pt] \left( x + \frac{1}{7}\right)^2 &= \frac{-6}{49} \\[5pt] x &= \frac{-1 ± i\sqrt{6}}{7} \end{align} 17 $8x^2 - 11x + 20 = 0$ Solution \begin{align} 8x^2 - 11x &= -20 \\[5pt] x^2 - \frac{11}{8}x &= \frac{-5}{2} \\[5pt] x^2 - \frac{11}{8}x + \left(\frac{11}{16}\right)^2 &= \frac{121 - 640}{256} \\[5pt] \left( x - \frac{11}{16}\right)^2 &= \frac{-519}{256} \\[5pt] x &= \frac{11 ± i \sqrt{519}}{16} \end{align} 18 $2x^2 + 13x - 26 = 0$ Solution \begin{align} 2x^2 + 13x &= 26 \\[5pt] x^2 + \frac{13}{2}x &= 13 \\[5pt] x^2 + \frac{13}{2}x + \left( \frac{13}{4}\right)^2 &= 13 + \frac{169}{16} \\[5pt] \left( x + \frac{13}{4}\right)^2 &= \frac{377}{16} \\[5pt] x &= \frac{-13 ± \sqrt{377}}{4} \end{align} 19 $-3x^2 - 3x + 5 = 0$ Solution \begin{align} -3x^2 - 3x &= -5 \\[5pt] x^2 + x &= \frac{5}{3} \\[5pt] x^2 + x + \left(\frac{1}{2}\right)^2 &= \frac{5}{3} + \frac{1}{4} \\[5pt] \left(x + \frac{1}{2} \right)^2 &= \frac{23}{12} \\[5pt] x &= \frac{-1}{2} ± \frac{\sqrt{23}}{2 \sqrt{3}} \end{align} 20 $-9x^2 + x + 7 = 0$ Solution \begin{align} -9x^2 + x &= -7 \\[5pt] x^2 - \frac{1}{9}x &= \frac{7}{9} \\[5pt] x^2 - \frac{1}{9}x + \left( \frac{1}{18} \right)^2 &= \frac{7}{9} + \frac{1}{324} \\[5pt] \left( x + \frac{1}{18} \right)^2 &= \frac{253}{324} \\[5pt] x &= \frac{-1 ± \sqrt{253}}{18} \end{align}

### Po-Shen Loh method

A new way of solving quadratics

In 2019, Carnegie-Mellon University math professor Po-Shen Loh devised a new method of finding quadratic roots that may well replace the quadratic formula and completing the square. Professor Po-Shen himself couldn't really believe that in 4000 years of solving quadratics, no one had thought about his method, but it seems that might be true.

#### Method for   $x^2 + Bx + C = 0$

In order to solve $x^2 + Bx + C = 0,$ we need to find a way to express it as

$$x^2 + Bx + C = (x - m)(x - n),$$

where the function is equal to zero if x = m or x = n. If we expand the right side, we get

$$x^2 + Bx + C = x^2 - (m + n)x + mn.$$

Now there is a correspondence: -B = m + n, and C = mn. We've seen that before. When we factor a quadratic with A = 1, we're looking for two numbers that multiply to C and add to B.

What Poh realized is that if m + n = -B, then their average would equal -B/2:

$$\frac{m + n}{2} = \frac{-B}{2}$$

Now there is some number, z, the midpoint between the two roots, such that our roots are

$$\frac{-B}{2} ± z.$$

In other words,

$$m = \frac{-B}{2} - z \; \text{ and } \; n = \frac{-B}{2} + z$$

Now we need only find that one number, z, in order to solve our quadratic equation. But first, let's make sure that these results are the same as those obtained using the quadratic formula. Recalling that mn = C, we can write:

$$\left( \frac{-B}{2} - z \right) \left( \frac{-B}{2} + z \right) = C$$

$$\frac{B^2}{4} + \frac{Bz}{2} - \frac{Bz}{2} - z^2 = C$$

The middle terms vanish, so we have

$$\frac{B^2}{4} - z^2 = C$$

Solving for z gives

$$z = ± \sqrt{\frac{B^2}{4} - C}$$

So our roots are

$$\frac{-B}{2} ± \sqrt{\frac{B^2}{4} - C},$$

which is the quadratic formula when A = 1.

#### Example – real roots

Let's solve a factorable function so we can easily check the method:

$$x^2 - x - 12 = 0$$

Our roots are

$$\frac{-B}{2} ± z = \frac{1}{2} ± z$$

Now our roots must multiply to C = -12:

\begin{align} \left( \frac{1}{2} + z \right) \left( \frac{1}{2} - z \right) &= -12 \\[5pt] \frac{1}{4} - z^2 &= -12 \\[5pt] z^2 &= \frac{49}{4} \\[5pt] z &= ± \frac{7}{2} \end{align}

Now our roots are

$$\frac{-1}{2} ± \frac{7}{2} = \bf 4, \; -3$$

That's exactly what we'd get from direct factoring. Now let's do a more complicated example.

#### Example – Imaginary roots

Solve $x^2 - 2x + 5 = 0$

The roots have the form

$$\frac{-B}{2} ± z = 1 ± z$$

then

\begin{align} (1 + z)(1 - z) &= 5 \\[5pt] 1 - z^2 &= 5 \\[5pt] -z^2 &= 4 \\[5pt] z &= \bf ± 2i \end{align}

That's pretty simple!

#### Method for   $Ax^2 + Bx + C$

Now let's let $A \ne 0$ and develop a more general version of the Po-Shen Loh method. If our equation is

$$Ax^2 + Bx + C = 0,$$

We can divide by A on both sides to get

$$x^2 + \frac{B}{A}x + \frac{C}{A} = (x - m)(x - n) = 0$$

If we expand the right side of the equation to

$$x^2 -(m + n)x + mn,$$

We find these correspondences:

$$\frac{-B}{A} = m + n, \; \text{ and } \; \frac{C}{A} = mn$$

If we divide the first correspondence by 2, thus obtaining the average of our two roots, m and n, we get

$$\frac{-B}{2A} = \frac{m + n}{2}$$

We'll call that average of m and n on the right side $z.$ The roots we seek are

$$\frac{-B}{2A} ± z$$

Let's go ahead and multiply those two roots using our second correspondence, $mn = \frac{C}{A},$

\begin{align} \left( \frac{-B}{2A} + z \right) \left( \frac{-B}{2A} - z \right) &= \frac{C}{A} \\[5pt] \frac{B^2}{4A^2} - z^2 &= \frac{C}{A} \\[5pt] z^2 &= \frac{B^2}{4A^2} - \frac{C}{A} \\[5pt] z^2 &= \frac{B^2}{4A^2} - \frac{4AC}{4A^2} \\[5pt] z &= ± \frac{\sqrt{B^2 - 4AC}}{2A} \end{align}

Now our roots are $\frac{-B}{2A} ± z,$ so they are

$$x = \frac{-B ± \sqrt{B^2 - 4AC}}{2A},$$

which is indeed the quadratic formula.

Now let's apply the method to a quadratic equation for which we already know the roots by easy factoring:

$$4x^2 + 6x + 2 = (2x + 1)(2x + 2) = 0,$$

where A = 4, B = 6 and C = 2. The roots are

$$\frac{-B}{2A} ± z \; \rightarrow \; \frac{-3}{4} ± z$$

Those roots multiply to $\frac{C}{A},$ so we have

\begin{align} \left( \frac{-3}{4} + z \right) \left( \frac{-3}{4} - z \right) &= \frac{C}{A} = \frac{1}{2} \\[5pt] \frac{9}{16} - z^2 &= \frac{1}{2} \\[5pt] -z^2 &= \frac{-9}{16} + \frac{8}{16} \\[5pt] z^2 &= \frac{1}{16} \\[5pt] z &= ±\frac{1}{4} \end{align}

So our roots are

\begin{align} x &= \frac{-3}{4} ± \frac{1}{4} \\[5pt] x &= \bf -1, \; -\frac{1}{2} \end{align}

... just what we expected.

Now in trying to go through the method very carefully, and making sure to link it to the quadratic formula, I fear I've made it seem more complicated than it really is. Here is a summary of the steps followed by 20 practice problems with solutions. Once you get used to the method, I think you'll find it's really easy.

#### Po-Shen Loh method

To solve a quadratic equation,   $Ax^2 + Bx + C = 0,$

1. Calculate the binomials $\left( \frac{-B}{2A} ± z \right)$ and multiply them.

2. Set the result equal to $\frac{C}{A},$ and solve for $z.$

3. Calculate the two roots using $\frac{-B}{2A} ± z.$

### Practice problems

Solve these quadratic equations using the Po-Shen Loh method.

 1 $3x^2 + 4x - 1 = 0$ Solution $$\frac{-B}{2A} = \frac{-2}{3} \; \text{ & } \; \frac{C}{A} = \frac{1}{3}$$ \begin{align} \left( \frac{-2}{3} + z \right) &\left( \frac{-2}{3} - z \right) = \frac{1}{3} \\[5pt] \frac{4}{9} - z^2 &= \frac{3}{9} \\[5pt] -z^2 &= -\frac{1}{9} \\[5pt] z &= ± \frac{1}{3} \\[5pt] x &= \frac{-2}{3} ± \frac{1}{3} \\[5pt] x &= \bf -\frac{1}{3}, \; -1 \end{align} 2 $x^2 - x - 7 = 0$ Solution $$\frac{-B}{2A} = \frac{1}{2} \; \text{ & } \; \frac{C}{A} = -7$$ \begin{align} \left( \frac{1}{2} + z \right) &\left( \frac{1}{2} - z \right) = -7 \\[5pt] \frac{1}{4} - z^2 &= \frac{-28}{4} \\[5pt] -z^2 &= -\frac{29}{4} \\[5pt] z &= ± \frac{\sqrt{29}}{2} \\[5pt] x &= \frac{1}{2} ± \frac{\sqrt{29}}{2} \\[5pt] x &= \bf \frac{1 ± \sqrt{29}}{2} \end{align} 3 $x^2 + x + 5 = 0$ Solution $$\frac{-B}{2A} = \frac{-1}{2} \; \text{ & } \; \frac{C}{A} = 5$$ \begin{align} \left( \frac{-1}{2} + z \right) &\left( \frac{-1}{2} - z \right) = 5 \\[5pt] \frac{1}{4} - z^2 &= \frac{20}{4} \\[5pt] -z^2 &= \frac{19}{4} \\[5pt] z &= ± -\frac{i\sqrt{19}}{2} \\[5pt] x &= -\frac{1}{2} ± \frac{i\sqrt{19}}{2} \\[5pt] x &= \bf \frac{-1 ± i\sqrt{19}}{2} \end{align} 4 $4x^2 - 4x - 5 = 0$ Solution $$\frac{-B}{2A} = \frac{1}{2} \; \text{ & } \; \frac{C}{A} = -\frac{5}{4}$$ \begin{align} \left( \frac{1}{2} + z \right) &\left( \frac{1}{2} - z \right) = -\frac{5}{4} \\[5pt] \frac{1}{4} - z^2 &= -\frac{5}{4} \\[5pt] -z^2 &= -\frac{6}{4} \\[5pt] z &= ± \frac{\sqrt{6}}{2} \\[5pt] x &= \bf \frac{1 ± \sqrt{6}}{2} \end{align} 5 $8x^2 + 7x + 8 = 0$ Solution $$\frac{-B}{2A} = \frac{-7}{16} \; \text{ & } \; \frac{C}{A} = 1$$ \begin{align} \left( \frac{-7}{16} + z \right) &\left( \frac{-7}{16} - z \right) = 1 \\[5pt] \frac{49}{256} - z^2 &= \frac{256}{256} \\[5pt] -z^2 &= \frac{207}{256} \\[5pt] z &= ± \frac{i\sqrt{207}}{16} \\[5pt] x &= \bf \frac{-7 ± \sqrt{207}}{16} \end{align} 6 $3x^2 - 3x + 2 = 0$ Solution $$\frac{-B}{2A} = \frac{1}{2} \; \text{ & } \; \frac{C}{A} = \frac{2}{3}$$ \begin{align} \left( \frac{1}{2} + z \right) &\left( \frac{1}{2} - z \right) = \frac{2}{3} \\[5pt] \frac{1}{4} - z^2 &= \frac{2}{3} \\[5pt] -z^2 &= \frac{5}{12} \\[5pt] z &= ± \frac{i\sqrt{5}}{\sqrt{12}} \\[5pt] x &= \bf \frac{1}{2} ± \frac{i\sqrt{5}}{2\sqrt{3}} \end{align} 7 $x^2 + 7x - 9 = 0$ Solution $$\frac{-B}{2A} = \frac{-7}{2} \; \text{ & } \; \frac{C}{A} = -9$$ \begin{align} \left( \frac{-7}{2} + z \right) &\left( \frac{-7}{2} - z \right) = -9 \\[5pt] \frac{49}{4} - z^2 &= \frac{-36}{4} \\[5pt] -z^2 &= -\frac{85}{4} \\[5pt] z &= ± \frac{\sqrt{85}}{2} \\[5pt] x &= \frac{-7}{2} ± \frac{\sqrt{85}}{2} \\[5pt] x &= \bf \frac{-7 ± \sqrt{85}}{2} \end{align} 8 $2x^2 + 7x - 5 = 0$ Solution $$\frac{-B}{2A} = \frac{-7}{4} \; \text{ & } \; \frac{C}{A} = \frac{-5}{2}$$ \begin{align} \left( \frac{-7}{4} + z \right) &\left( \frac{-7}{4} - z \right) = -\frac{5}{2} \\[5pt] \frac{49}{16} - z^2 &= \frac{-40}{16} \\[5pt] -z^2 &= -\frac{89}{16} \\[5pt] z &= ± \frac{\sqrt{89}}{4} \\[5pt] x &= \frac{-7}{4} ± \frac{\sqrt{89}}{4} \\[5pt] x &= \bf \frac{-7 ± \sqrt{89}}{4} \end{align} 9 $3x^2 + 11x - 8 = 0$ Solution $$\frac{-B}{2A} = \frac{-11}{6} \; \text{ & } \; \frac{C}{A} = \frac{-8}{3}$$ \begin{align} \left( \frac{-11}{6} + z \right) &\left( \frac{-11}{6} - z \right) = \frac{-8}{3} \\[5pt] \frac{121}{36} - z^2 &= \frac{-96}{36} \\[5pt] -z^2 &= -\frac{-217}{36} \\[5pt] z &= ± \frac{\sqrt{217}}{6} \\[5pt] x &= \frac{-11}{6} ± \frac{\sqrt{217}}{6} \\[5pt] x &= \bf \frac{-11 ± \sqrt{217}}{6} \end{align} 10 $4x^2 + 8x + 11 = 0$ Solution $$\frac{-B}{2A} = -1 \; \text{ & } \; \frac{C}{A} = \frac{11}{4}$$ \begin{align} \left( -1 + z \right) &\left( -1 - z \right) = \frac{11}{4} \\[5pt] 1 - z^2 &= \frac{11}{4} \\[5pt] -z^2 &= \frac{7}{4} \\[5pt] z &= ± \frac{i\sqrt{7}}{2} \\[5pt] x &= \bf -1 ± \frac{i\sqrt{7}}{2} \end{align}

 11 $6x^2 + 5x + 23 = 0$ Solution $$\frac{-B}{2A} = -\frac{5}{12} \; \text{ & } \; \frac{C}{A} = \frac{23}{6}$$ \begin{align} \left( -\frac{5}{12} + z \right) &\left( -\frac{5}{12} - z \right) = \frac{23}{6} \\[5pt] \frac{25}{144} - z^2 &= \frac{23}{6} \\[5pt] \frac{25}{144} - z^2 &= \frac{552}{144} \\[5pt] -z^2 &= \frac{527}{144} \\[5pt] z &= -\frac{5}{12} ± \frac{i\sqrt{527}}{12} \\[5pt] x &= \bf \frac{-5 ± i\sqrt{527}}{12} \end{align} 12 $11x^2 + 2x + 1 = 0$ Solution $$\frac{-B}{2A} = -\frac{1}{11} \; \text{ & } \; \frac{C}{A} = \frac{1}{11}$$ \begin{align} \left( \frac{-1}{11} + z \right) &\left( \frac{-1}{11} - z \right) = \frac{1}{11} \\[5pt] \frac{1}{121} - z^2 &= \frac{1}{11} \\[5pt] \frac{1}{121} - z^2 &= \frac{11}{121} \\[5pt] -z^2 &= \frac{10}{121} \\[5pt] z &= -\frac{1}{11} ± \frac{i\sqrt{10}}{11} \\[5pt] x &= \bf \frac{-1 ± i\sqrt{10}}{11} \end{align} 13 $9x^2 + 9x - 3 = 0$ Solution $$\frac{-B}{2A} = \frac{-1}{2} \; \text{ & } \; \frac{C}{A} = \frac{-1}{3}$$ \begin{align} \left( \frac{-1}{2} + z \right) &\left( \frac{-1}{2} - z \right) = -\frac{1}{3} \\[5pt] \frac{1}{4} - z^2 &= -\frac{1}{3} \\[5pt] -z^2 &= -\frac{7}{12} \\[5pt] z &= ±\frac{\sqrt{5}}{2\sqrt{3}} \\[5pt] x &= \bf -\frac{1}{2} ± \frac{\sqrt{7}}{2\sqrt{3}} \end{align} 14 $4x^2 + 5x - 13 = 0$ Solution $$\frac{-B}{2A} = \frac{-5}{8} \; \text{ & } \; \frac{C}{A} = \frac{-13}{4}$$ \begin{align} \left( \frac{-5}{8} + z \right) &\left( \frac{-5}{8} - z \right) = -\frac{13}{4} \\[5pt] \frac{25}{64} - z^2 &= -\frac{13}{4} \\[5pt] \frac{25}{64} - z^2 &= -\frac{208}{64} \\[5pt] -z^2 &= -\frac{183}{64} \\[5pt] z &= ±\frac{\sqrt{183}}{8} \\[5pt] x &= -\frac{-5}{8} ± \frac{\sqrt{7}}{2\sqrt{3}} \\[5pt] \end{align} 15 $5x^2 + 4x + 4 = 0$ Solution $$\frac{-B}{2A} = \frac{-2}{5} \; \text{ & } \; \frac{C}{A} = \frac{4}{5}$$ \begin{align} \left( \frac{-2}{5} + z \right) &\left( \frac{-2}{5} - z \right) = \frac{4}{5} \\[5pt] \frac{4}{25} - z^2 &= \frac{4}{5} \\[5pt] \frac{4}{25} - z^2 &= \frac{20}{25} \\[5pt] -z^2 &= \frac{16}{25} \\[5pt] z &= ±\frac{4i}{5} \\[5pt] x &= -\frac{-2}{5} ± \frac{4i}{5} \\[5pt] x &= \bf \frac{-2 ± 4i}{5} \end{align} 16 $x^2 - 14 = 0$ Solution $$\frac{-B}{2A} = 0 \; \text{ & } \; \frac{C}{A} = -14$$ \begin{align} \left( 0 + z \right) &\left( 0 - z \right) = -14 \\[5pt] - z^2 &= -14 \\[5pt] z &= ± \sqrt{14} \\[5pt] x &= 0 ± \sqrt{14} \\[5pt] x &= \bf ± \sqrt{14} \end{align} 17 $x^2 + 7x + 7 = 0$ Solution $$\frac{-B}{2A} = \frac{-7}{2} \; \text{ & } \; \frac{C}{A} = 7$$ \begin{align} \left( \frac{-7}{2} + z \right) &\left( \frac{-7}{2} - z \right) = 7 \\[5pt] \frac{49}{4} - z^2 &= 7 \\[5pt] \frac{49}{4} - z^2 &= \frac{28}{4} \\[5pt] -z^2 &= \frac{-21}{4} \\[5pt] z &= ±\frac{\sqrt{21}}{2} \\[5pt] x &= \frac{-7}{2} ±\frac{\sqrt{21}}{2} \\[5pt] x &= \bf \frac{-7 ± \sqrt{21}}{2} \end{align} 18 $x^2 + 7x - 7 = 0$ Solution $$\frac{-B}{2A} = \frac{-7}{2} \; \text{ & } \; \frac{C}{A} = -7$$ \begin{align} \left( \frac{-7}{2} + z \right) &\left( \frac{-7}{2} - z \right) = -7 \\[5pt] \frac{49}{4} - z^2 &= -7 \\[5pt] \frac{49}{4} - z^2 &= \frac{-28}{4} \\[5pt] -z^2 &= \frac{-77}{4} \\[5pt] z &= ±\frac{\sqrt{77}}{2} \\[5pt] x &= \frac{-7}{2} ±\frac{\sqrt{77}}{2} \\[5pt] x &= \bf \frac{-7 ± \sqrt{77}}{2} \end{align} 19 $5x^2 - 11x - 12 = 0$ Solution $$\frac{-B}{2A} = \frac{11}{10} \; \text{ & } \; \frac{C}{A} = \frac{-12}{5}$$ \begin{align} \left( \frac{11}{10} + z \right) &\left( \frac{11}{10} - z \right) = -\frac{12}{5} \\[5pt] \frac{121}{100} - z^2 &= -\frac{12}{5} \\[5pt] \frac{121}{100} - z^2 &= -\frac{240}{100} \\[5pt] -z^2 &= \frac{-361}{100} \\[5pt] z &= ±\frac{\sqrt{361}}{10} \\[5pt] x &= \frac{11}{10} ±\frac{19}{10} \\[5pt] x &= \frac{11 ± 19}{10} \\[5pt] x &= \bf 3, \; -\frac{4}{5} \end{align} 20 $7x^2 - 2x + 1 = 0$ Solution $$\frac{-B}{2A} = \frac{1}{7} \; \text{ & } \; \frac{C}{A} = \frac{1}{7}$$ \begin{align} \left( \frac{1}{7} + z \right) &\left( \frac{1}{7} - z \right) = \frac{1}{7} \\[5pt] \frac{1}{49} - z^2 &= \frac{1}{7} \\[5pt] \frac{1}{49} - z^2 &= \frac{7}{49} \\[5pt] -z^2 &= \frac{6}{49} \\[5pt] z &= ±\frac{i\sqrt{6}}{7} \\[5pt] x &= \frac{1}{7} ± \frac{i\sqrt{6}}{7} \\[5pt] x &= \bf \frac{1 ± i\sqrt{6}}{7} \\[5pt] \end{align}

### Video examples

#### 4. Completing the square: Example 1

In this example we complete the square to find the roots of a function for which we already know the roots. It's a good example to work through to see that completing the square works!

#### 5. Completing the square: Example 2

In this example, the quadratic function f(x) = 8x2 - 20x - 3 has real roots, but it's not factorable. We complete the square to find the exact roots of the function. There is no difference between completing the square and using the quadratic formula, but I think that knowing how to complete the square will help you to understand a lot about basic algebra steps. You should learn it! #### 7. Derivation of the quadratic formula – a must-see.

In this example, we start with f(x) = Ax2 + Bx + C and complete the square to derive the quadratic formula.

Minutes of your life: 2:04 (and well worth it!)

#### 8. Completing the square to obtain imaginary roots

In this example, we find the roots of f(x) = 3x2 - 4x + 7, which are imaginary (or more accurately, are complex with non-zero imaginary parts. We also use the discriminant to show how to determine before-hand that the roots of a quadratic function will be non-real.  