Completing the square

Completing the square is an algorithm by which the standard form of a quadratic is transformed into the vertex form. For the purpose of this summary, we take \(3x^2-24x+7\) as an example.

  1. If \(a\neq 1\), we take \(a\) as a common factor from the first two terms (that have \(x^2\) and \(x\)) \[\underline{3}x^2-24x+7=\underline{3}(x^2-8x)+7\]
  2. We then divide the coefficient of \(x\) by 2 \[3(x^2\underline{{}-8}x)+7\rightarrow \dfrac{-8}{2}=-4\]
  3. We square the value obtained in step (2) \[(-4)^2=16\]
  4. We add and subtract the value obtained in step (3) to the first two terms (inside the brackets if we took \(a\) as a common factor). The added value will make the complete square. \[3(x^2-8x)+7=3(\underline{x^2-8x+16}-16)+7\]
  5. Those three terms make a squared binomial \((x+h)^2\), where \(h\) is the value obtained in step (2). \[3[(x\underline{{}-4})^2-16]+7\]
  6. If we took a common factor in the first step, then we multiply it back (without opening the squared brackets) and simplify the expression. \begin{align}3[(x-4)^2-16]+7 &= 3(x-4)^2-48+7 \\ &= 3(x-4)^2-41\end{align}
\[\therefore 3x^2-24x+7=3(x-4)^2-41\]