freeCodeCamp/guide/english/mathematics/completing-the-square/index.md

2.2 KiB

title
Completing the Square

Completing the Square

The completing the square method is one of the many methods for solving a quadratic eduation. It involves changing the form of the equation so that the left side becomes a perfect square.

A quadratic equation generally takes the form: ax2 + bx + c = 0. In solving the above, follow the following steps:

  1. Move the constant value to the Right Hand Side of the equation so it becomes:
ax2 + bx = -c
  1. Make the coefficient of x2 equal to 1 by dividing both sides of the equation by a so that we now have:
x2 + (b/a)x = - (c/a)
  1. Next, add the square of half of the coefficient of the x-term to both sides of the equation:
x2 + (b/a)x  + (b/2a)2 = (b/2a)2 - (c/a)
  1. Completing the square on the Left Hand Side and simplifying the Right Hand Side of the above equation, we have:
(x + b/2a)2 = (b2/4a2) - (c/a)
  1. Further simplpfying the Right Hand Side,
(x + b/2a)2 = (b2 - 4ac)/4a2 
  1. Finding the square root of both sides of the equation,
x + b/2a = √(b2 - 4ac) ÷ 2a 
  1. By making x the subject of our formula, we are able to solve for its value completely:
x = -b ± √(b2 - 4ac) ÷ 2a 

More Information: