If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Completing the square review

Completing the square is a technique for factoring quadratics. This article reviews the technique with examples and even lets you practice the technique yourself.

What is completing the square?

Completing the square is a technique for rewriting quadratics in the form left parenthesis, x, plus, a, right parenthesis, squared, plus, b.
For example, x, squared, plus, 2, x, plus, 3 can be rewritten as left parenthesis, x, plus, 1, right parenthesis, squared, plus, 2. The two expressions are totally equivalent, but the second one is nicer to work with in some situations.

Example 1

We're given a quadratic and asked to complete the square.
x, squared, plus, 10, x, plus, 24, equals, 0
We begin by moving the constant term to the right side of the equation.
x, squared, plus, 10, x, equals, minus, 24
We complete the square by taking half of the coefficient of our x term, squaring it, and adding it to both sides of the equation. Since the coefficient of our x term is 10, half of it would be 5, and squaring it gives us start color #11accd, 25, end color #11accd.
x, squared, plus, 10, x, start color #11accd, plus, 25, end color #11accd, equals, minus, 24, start color #11accd, plus, 25, end color #11accd
We can now rewrite the left side of the equation as a squared term.
left parenthesis, x, plus, 5, right parenthesis, squared, equals, 1
Take the square root of both sides.
x, plus, 5, equals, plus minus, 1
Isolate x to find the solution(s).
x, equals, minus, 5, plus minus, 1
Want to learn more about completing the square? Check out this video.

Example 2

We're given a quadratic and asked to complete the square.
4, x, squared, plus, 20, x, plus, 25, equals, 0
First, divide the polynomial by 4 (the coefficient of the x, squared term).
x, squared, plus, 5, x, plus, start fraction, 25, divided by, 4, end fraction, equals, 0
Note that the left side of the equation is already a perfect square trinomial. The coefficient of our x term is 5, half of it is start fraction, 5, divided by, 2, end fraction, and squaring it gives us start color #11accd, start fraction, 25, divided by, 4, end fraction, end color #11accd, our constant term.
Thus, we can rewrite the left side of the equation as a squared term.
left parenthesis, x, plus, start fraction, 5, divided by, 2, end fraction, right parenthesis, squared, equals, 0
Take the square root of both sides.
x, plus, start fraction, 5, divided by, 2, end fraction, equals, 0
Isolate x to find the solution.
The solution is: x, equals, minus, start fraction, 5, divided by, 2, end fraction

Practice

Problem 1
Complete the square to rewrite this expression in the form left parenthesis, x, plus, a, right parenthesis, squared, plus, b.
x, squared, minus, 2, x, plus, 17

Want more practice? Check out these exercises:

Want to join the conversation?

  • leafers tree style avatar for user jepsomad000
    need to complete the square, the problem is x^2 +10x+blank
    (5 votes)
    Default Khan Academy avatar avatar for user
  • old spice man blue style avatar for user jansenhuang25
    In problem 2, the question have the same answer in both X1 and X2. However the problem doesn't automatically consider the answer when it is in X1 = 10, while X2 = 4
    (4 votes)
    Default Khan Academy avatar avatar for user
  • duskpin sapling style avatar for user Makayla
    I find it frusterating and a bit unfair that in both the review and the videos, the problems they show are equations like 4x^2 +20x + 24, while the problems we are given in the practices include functions: h(x) = x^2 +3x -18.
    Can someone give me advice on dealing with the functions? I know how they work, but how can I do something to "both sides of the equation" when there is only one side to begin with?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Enrique Bracamontes
    how to you solve x squared + 11x + 24
    (2 votes)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Allison Lee
      First you move the constant, 24, off to the side, so it looks like x^2 + 11x = 24. Then you halve 11, to get 5.5 Square that, and you get 30.25. Add that to the equation as x^2 + 11x + 30.25 = 24 +30.25. The left part of the equation is now perfect - you would get (x + 5.5)^2 = 54.25.



      To be entirely honest, I am only partly sure I even got that right. I'm not quite a mathematician, so feel free to correct me.
      I am also fully aware that this is about a month late.
      (3 votes)
  • duskpin ultimate style avatar for user Clark Fischer
    Can you just use the quadratic formula for all of these?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user villanian
      You can use the derivative of the equation to find the vertex, by setting the equation equal to 0 and then using this formula:
      0=ax^2+bx+c=2ax+b, where x is the x-value of the vertex, and you can plug this in to the original equation to find the y value of the vertex, in essence finding you the vertex of the graph.
      (3 votes)
  • leaf green style avatar for user Anna W
    What's the difference between solving a quadratic equation set equal to zero by completing the square and rewriting a quadratic function from standard form to vertex form by completing the square?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • aqualine sapling style avatar for user Mekenzie.ballard
    In the practice problem x^2-2x+17. I do not understand how you get 16.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      To complete the square for "x^2-2x", you need to add 1
      "x^2-2x+1" = "(x-1)^2"
      But, the not change the original polynomial, you then need to subtract 1 from 17 (+ 1 and then -1 = 0, so the polynomial is not changed, we just shifted numbers around).
      This gets you: "(x-1)^2 + 16"
      Hope this helps.
      (3 votes)
  • blobby green style avatar for user 😊
    how to solve x^2-2x-24=0?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • primosaur sapling style avatar for user Hiba Adil
    I'm having an issue when completing the square with trinomials that all have 'minus' signs. It won't work for me for some reason! Here is what it looks like: x^2-2x-168
    Can someone help please
    (2 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      Completing the square just requires you to divide the middle term by 2 and square it, so -2/2 = -1 and (-1)^2 = 1. So you end up with (x^2 -2x + 1) - 168 -1 (you have to subtract 1 to balance the 1 you added). You will end up with (x - 1)^2 - 169.
      (2 votes)
  • old spice man green style avatar for user connor hill
    I am still having trouble with the fractions aspect of this topic. Can some please explain? it would mean the world to me
    (2 votes)
    Default Khan Academy avatar avatar for user
    • hopper cool style avatar for user ???
      (by the way, ^2 means squared)
      x^2 + 2x + 6 = 0
      -6 -6
      -----------------------
      x^2+2x=-6
      x^2 + 2x + 2/1(because it's the b of ax squared + bx + c) = -6 + 2/1(you add to both sides)
      (you do this so you can get a square function)
      x^2 + 2x + 1 = -5
      (x + 1) ^ 2 = -5
      you do square root and you get: x + 1 = positive and negative square root of 5
      subtract 1 from both sides and you get:
      x = + and - square root of 5
      does this help?
      (2 votes)