28
$\begingroup$

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?

$\endgroup$
7
  • 3
    $\begingroup$ 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. $\endgroup$ May 31, 2015 at 21:26
  • $\begingroup$ @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? $\endgroup$ May 31, 2015 at 21:35
  • 3
    $\begingroup$ 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$. $\endgroup$ May 31, 2015 at 21:40
  • 1
    $\begingroup$ @RoryDaulton, That makes sense, thanks for the explanation. $\endgroup$ May 31, 2015 at 21:46
  • 3
    $\begingroup$ 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. $\endgroup$ May 31, 2015 at 22:03

6 Answers 6

40
$\begingroup$

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.

$\endgroup$
2
  • 13
    $\begingroup$ Wow, I had no idea that was where the QF came from, I need to work through this carefully. Thanks. $\endgroup$ May 31, 2015 at 21:44
  • 3
    $\begingroup$ I took the liberty of reformatting your answer for better readability. I hope you won't mind... $\endgroup$
    – A.P.
    May 31, 2015 at 21:50
7
$\begingroup$

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). $$

$\endgroup$
3
  • 1
    $\begingroup$ If $a < 0$, why not just negate the whole equation? That seems simpler to me. $\endgroup$
    – Kevin
    Jun 1, 2015 at 15:12
  • $\begingroup$ @Kevin : Because $\sqrt{a}$ becomes problematic then, so I wrote $\sqrt{|a|}$. ${}\qquad{}$ $\endgroup$ Jun 1, 2015 at 17:10
  • $\begingroup$ Oh, I see what you're doing. I was thinking something more like let $a'=-a$, $b'=-b$, $c'=-c$, and then solve $a'x^2 + b'x+c'=0$ as normal. $\endgroup$
    – Kevin
    Jun 1, 2015 at 17:43
6
$\begingroup$

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.

$\endgroup$
1
  • 3
    $\begingroup$ Which is fine until you have an $xy$ term, of course. $\endgroup$
    – Chappers
    Jun 1, 2015 at 12:44
3
$\begingroup$

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}) $$

$\endgroup$
2
$\begingroup$

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}

$\endgroup$
1
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .