28

I was taught that you could only complete the square of a quadratic if the coefficient on the $x^2$ term is 1.

However, playing a little bit with other quadratics, I've found that it's just not true. Based on the CTS algorithm, you just need to divide the coefficient of the $x$ term by twice the square root of the coefficient of the $x^2$ term.

So, if you have $ax^2 + bx + c$, your perfect square would be $(\sqrt{a}x + \frac{b}{2 \sqrt{a}})^2$

If $a$ is not a perfect square it could get nasty, but then you can just square the whole quadratic and go from there.

For example:

In the equation $5x^2 + 6x + 5 = 0$, we could do:

$25x^2 + 30x + 25 = 0$

$(5x+3)^2 = -16$

$5x+3 = \pm4i$

$x = \pm \frac{4i}{5} - \frac{3}{5}$

My questions are:

-Is this correct?

-Is there ever an advantage to using the quadratic formula?

-Are there quadratics that are unsolvable this way?

  • 3
    This way does not work if $a<0$. It could be modified, of course. Also, your example does not use the "perfect square" you note previously. – Rory Daulton May 31 '15 at 21:26
  • @RoryDaulton, I added the square to $(\sqrt{a}x + \frac{b}{2 \sqrt{a}})^2$, but I'm pretty sure I'm using the right coefficients, could you point it out? And of course it won't work as such if $a < 0$, but then you can just multiply by $-1$, which doesn't seem very limiting. Are there other limiting factors to using this? – jeremy radcliff May 31 '15 at 21:35
  • 3
    You did use the right coefficients, you just "cheated" by changing $ax^2+bx+c$ to $a^2x^2+abx+ac$ in your example. This shows that your way is usually not the best. @Spencer's answer shows the usual method, which avoids square roots as long as possible by changing the quadratic to $x^2+\frac ba x+\frac ca$. – Rory Daulton May 31 '15 at 21:40
  • 1
    @RoryDaulton, That makes sense, thanks for the explanation. – jeremy radcliff May 31 '15 at 21:46
  • 3
    In general, if you start with $ax^2+bx+c=0$, it can be useful to multiply and divide by $4a$, getting $\frac{1}{4a}(4a^2+4abx+4ac)=0$. Now the square can be completed with no trouble always, we get $(2ax+b)^2+4ac$. You don't really need the quadratic formula, though it can be handy when we are telling a computer how to find the roots. – André Nicolas May 31 '15 at 22:03
  • Just as an aside, if $b > 0$ and $0<4ac<<b^2$, then $\dfrac{-b + \sqrt{b^2-4ac}}{2a}$ is numerically unstable. In this case, it's better to rationalize the numerator and use $\dfrac{-2c}{b+\sqrt{b^2-4ac}}$ – Steven Alexis Gregory Jul 12 '17 at 04:08

6 Answers6

40

Every quadratic can have its square completed, which is in fact where the quadratic formula comes from.

The method I use is to factor out the leading coefficient,

$$ \begin{align} \color{red}{a} x ^2 + bx +c &= \color{red}{a}\left( x^2 + \frac{b}{\color{red}{a}} x \right) + c \\ &= a\left( \left(x+\frac{b}{2a}\right)^2 - \frac{b^2}{4a^2} \right) + c \\ &= a\left(x+\frac{b}{2a}\right)^2 + c-\frac{b^2}{4a}, \end{align} $$

if you solve for when this is equal to zero you will get the quadratic formula.

A.P.
  • 9,728
Spencer
  • 12,271
8

The proposed way of completing the square is correct. The identity is: $$ ax^2 + bx + c = \left(\sqrt{a}x + \frac{b}{2 \sqrt{a}}\right)^2 + \left(c-\frac{b^2}{2a}\right). $$

One can of course also do what is more usually done and write $$ ax^2+bx+c = a\left( x + \frac{b}{2a} \right)^2 + \left(c-\frac{b^2}{2a}\right). $$ The latter way is done for the sake of convenience, not because it is the only way possible.

PS: Someone points out in comments that this works only if $a>0$. If $a<0$, one can write: $$ ax^2 + bx + c = -\left(\sqrt{|a|}x + \frac{b}{2 \sqrt{|a|}}\right)^2 + \left(c-\frac{b^2}{2a}\right). $$

6

It seems like your questions have been answered, so this response is more of an addition. Completing the square is a useful rearrangement in and of itself - beyond the usage for solving quadratics. You may be aware of its application in placing the equation of a conic section in standard form.

For example, consider

$$x^2 + 2x + 2y^2 + y + 3 = 6$$

ellipse

This is an ellipse, but our equation does not tell us much information. Rearranging into standard form will reveal quite a bit of info. Standard form for a horizontal ellipse is given as

$$\frac{(x-h)^2}{a^2} + \frac{(y-k)^2}{b^2} = 1$$

where $(h,k)$ is the center and $a$ and $b$ represent the semi-major and semi-minor axes respectively (the longest and shortest "radius" of this "eccentric circle").

In order to place our ellipse into standard form, we complete the square twice:

$$x^2 + 2x + 2y^2 + 4y + 3 = 6$$ $$\left(x^2 + 2x \color{red}{+1}\right) + 2\left(y^2 + 4y \color{red}{+4}\right)+ 3 = 6 \color{red}{+1} \color{red}{+8} $$ $$(x+1)^2+ 2(y+2)^2+ 3 = 15 $$ $$(x+1)^2+ 2(y+2)^2 = 12 $$ $$\frac{(x+1)^2}{12}+ \frac{(y+2)^2}{6} = 1 $$

We now see that we have an ellipse centered at $(h,k) = (-1,-2)$ with semi-major axis $a = \sqrt{12}$ and semi-minor axis $b=\sqrt6$. This matches the graph.

zahbaz
  • 10,441
3

If $a$ is not a “perfect square” there's no problem either. If your equation is $$ ax^2+bx+c=0 $$ then it's equivalent to $$ 4a^2x^2+4abx+4ac=0 $$ and completing the square is more evident: $$ 4a^2x^2+4abx+b^2-b^2+4ac=0 $$ or $$ (2ax+b)^2-(b^2-4ac)=0 $$ If you just want to factor the polynomial $ax^2+bx+c$ (with $a\ne0$, of course, just do the same: $$ ax^2+bx+c=\frac{1}{4a}(4a^2x^2+4abx+4ac)= \frac{1}{4a}\bigl((2ax+b)^2-(b^2-4ac)\bigr) $$ If $b^2-4ac<0$ there's nothing else to do, because the polynomial is irreducible over the reals; if $b^2-4ac=0$ it is $$ \frac{1}{4a}(2ax+b)^2 $$ and, if $b^2-4ac>0$ you get $$ ax^2+bx+c=\frac{1}{4a}(x+2a-\sqrt{b^2-4ac})(x+2a+\sqrt{b^2-4ac}) $$

egreg
  • 238,574
2

One method that avoids fractions until the very end is to multiply through by $4a$.

\begin{align} ax^2 + bx + c &= 0 \\ 4a^2x^2 + 4abx + 4ac &= 0 \\ 4a^2x^2 + 4abx + b^2 &= b^2 - 4ac \\ (2ax + b)^2 = b^2 - 4ac \\ 2ax + b &= \pm \sqrt{b^2 - 4ac} \\ x &= \dfrac{-b \pm \sqrt{b^2-4ac}}{2a} \end{align}

1

Actually, the quadratic formula is derived BY completing the square. Yes, any quadratic equation can be solved by completing the square. The only reason to use the quadratic formula is that it might be simpler than completing the square.