Complete the Square Calculator
Use the Complete the Square Calculator to rewrite quadratic expressions, see solution steps, and solve quadratic equations for \(x\).
Start with one of these quadratic examples
How to Use the Complete the Square Calculator
-
Add Your Problem
Use Calculator for keypad entry or Math Input to type a quadratic expression or equation. You can also use Canvas to write the problem by hand or upload a clear photo.
-
Choose Your Output
Step-by-step answers are selected by default. You can also choose Explain Like I’m 10, Create Practice Test, Create Study Guide, Create Flashcards, Find My Mistake, or Create Graph when a quadratic function is suitable for graphing.
-
Choose a Language
Open the language dropdown labeled “Default” and select the language you want for the explanation.
-
Get the Result
Select Solve to submit your problem. The calculator returns the requested solution steps or learning output.
How to Complete the Square
Completing the square is a method for quadratic expressions and equations. Its goal is to turn the \(x^2\) and \(x\) terms into a binomial square, such as \((x-4)^2\).
You can use this method to rewrite a quadratic in vertex form or solve a quadratic equation. It works most cleanly after arranging the equation so the quadratic and linear terms are together. If you want to compare approaches for solving quadratics, see these quadratic equation steps.
Put the Quadratic in the Right Form
Start by identifying a quadratic: it has an \(x^2\) term, an \(x\) term, and possibly a constant. Standard form is:
\[ ax^2+bx+c=0 \]
For solving, move the constant away from the \(x^2\) and \(x\) terms before building a perfect-square trinomial. For example:
\[ x^2+6x-7=0 \]
becomes:
\[ x^2+6x=7 \]
This setup matters because you will add the same number to both sides. That keeps the equation balanced. Completing the square is primarily for quadratics; if your equation has a different structure, a tool to solve more general equations may be more useful.
Sometimes a quadratic has simple factor pairs, so it may be faster to check whether the quadratic factors. But completing the square still works when factoring is awkward or impossible over the integers.
Complete the Square When \(a=1\)
Use this version when the coefficient of \(x^2\) is \(1\). Once the constant is on the other side, take half the coefficient of \(x\), then square that result.
For:
\[ x^2+6x=7 \]
half of \(6\) is \(3\), and:
\[ 3^2=9 \]
Add \(9\) to both sides:
\[ x^2+6x+9=7+9 \]
Now the left side is a perfect-square trinomial:
\[ (x+3)^2=16 \]
To solve, use the square-root property:
\[ x+3=\pm4 \]
Then solve both cases:
\[ x=1 \quad \text{or} \quad x=-7 \]
The \(\pm\) matters because both \(4^2\) and \((-4)^2\) equal \(16\). If the isolated square equals a negative real number, there is no real solution. For instance, \((x+3)^2=-5\) has no real-number solution, although complex solutions exist.
Complete the Square When \(a \ne 1\)
When the coefficient of \(x^2\) is not \(1\), first divide every term by \(a\). Do not divide only the \(x^2\) term
Suppose you have:
\[ 2x^2-12x+7=0 \]
First move the constant:
\[ 2x^2-12x=-7 \]
Then divide every term by \(2\):
\[ x^2-6x=-\frac{7}{2} \]
Now you can use the usual process. Half of \(-6\) is \(-3\), and \((-3)^2=9\).
\[ x^2-6x+9=-\frac{7}{2}+9 \]
\[ (x-3)^2=\frac{11}{2} \]
An equivalent approach is to factor \(a\) correctly from the quadratic and linear terms before completing the square. For example, \(2x^2-12x\) can become \(2(x^2-6x)\), but the value added inside the parentheses must be accounted for outside them. Dividing through is often easier to track.
Understanding Completing the Square
A perfect-square trinomial comes from multiplying a binomial by itself:
\[ (x+p)^2=x^2+2px+p^2 \]
That middle term, \(2px\), explains the rule. If the coefficient of \(x\) is \(b\), then \(2p=b\), so \(p=\frac{b}{2}\). The needed final term is therefore:
\[ \left(\frac{b}{2}\right)^2 \]
Completed-square form also reveals a parabola’s vertex. A quadratic written as:
\[ a(x-h)^2+k \]
is in vertex form, and its vertex is \((h,k)\). Notice the sign carefully: \((x-3)^2\) gives \(h=3\), while \((x+3)^2=(x-(-3))^2\) gives \(h=-3\).
If you enter a quadratic function rather than an equation, Create Graph can help you connect the completed-square form to the parabola’s location. You can also explore Algebra calculators for related practice.
Worked Example
Solve:
\[ 2x^2-12x+7=0 \]
-
Move the constant term.
\[ 2x^2-12x=-7 \]
Keep the quadratic and linear terms together before creating the square.
-
Divide every term by \(2\).
\[ x^2-6x=-\frac{7}{2} \]
The \(x^2\) coefficient must be \(1\) before using the half-and-square rule directly.
-
Add the square of half the \(x\)-coefficient.
\[ \left(\frac{-6}{2}\right)^2=(-3)^2=9 \]
\[ x^2-6x+9=-\frac{7}{2}+9 \]
Add \(9\) to both sides so the equation stays equal.
-
Rewrite the trinomial and simplify.
\[ (x-3)^2=\frac{11}{2} \]
The left side is now a binomial square.
-
Take square roots and solve.
\[ x-3=\pm\sqrt{\frac{11}{2}} \]
\[ \boxed{x=3\pm\sqrt{\frac{11}{2}}} \]
So the two real solutions are:
\[ \boxed{x=3+\sqrt{\frac{11}{2}} \quad \text{or} \quad x=3-\sqrt{\frac{11}{2}}} \]
Verification works by substitution. If \(x=3\pm\sqrt{\frac{11}{2}}\), then \((x-3)^2=\frac{11}{2}\), which reverses the completed-square steps and satisfies the original equation.
Common Mistakes
-
Adding \(\left(\frac{b}{2}\right)^2\) to one side only.
A student may add the needed value to the left side and forget the right side. That changes the equation instead of preserving equality. Whatever you add to form the square must be added to both sides.
-
Using the original \(x\)-coefficient before dividing by \(a\).
In \(2x^2-12x=-7\), using half of \(-12\) gives the wrong added value. Divide every term by \(2\) first, so the working equation is \(x^2-6x=-\frac72\).
-
Leaving the constant on the left.
Students sometimes add the square term while \(c\) is still mixed with the \(x\)-terms. Move the constant first, then build the perfect-square trinomial from only the quadratic and linear terms.
-
Writing the binomial with the wrong sign.
Half of \(-6\) is \(-3\), so \(x^2-6x+9=(x-3)^2\), not \((x+3)^2\). Check by expanding the binomial: its middle term should match the original linear term.
-
Forgetting \(\pm\), or treating a negative value as a real square root.
From \((x-3)^2=\frac{11}{2}\), there are two square roots, not one. But from \((x-3)^2=-4\), there is no real solution because a real square cannot be negative.
Related Calculators
Completing the Square Questions Students Ask
What is completing the square?
+Completing the square rewrites a quadratic so its variable terms become a perfect-square trinomial. For equations, that makes the square-root property available. For expressions, it can produce vertex form.
How do I complete the square when the coefficient of \( x^2 \) is 1?
+Move the constant to the other side, if you are solving an equation. Then take half the coefficient of \(x\), square it, and add that value to both sides. Rewrite the left side as a squared binomial.
What do I do when the coefficient of \(x^2\) is not 1?
+Usually, divide every term of the equation by the leading coefficient first. Then the \(x^2\) coefficient becomes \(1\), and you can use the normal half-and-square rule. You may also factor the leading coefficient from the first two terms, but you must adjust for anything added inside the parentheses.
Why do I add the same number to both sides?
+An equation says both sides have the same value. Adding the same number to each side preserves that equality. Adding a number to only one side creates a different equation with different solutions.
Why is the number added half the coefficient of \(x\), squared?
+A binomial square expands as \((x+p)^2=x^2+2px+p^2\). To match \(bx\), you need \(2p=b\), so \(p=\frac{b}{2}\). The matching constant term is \(p^2\).
How do I solve for \(x\) after completing the square?
+Rewrite the left side as \((x-h)^2\), then take square roots of both sides. Use \(\pm\) when the right side is positive, and then isolate \(x\). If the right side is zero, both square-root paths give the same answer.
How does completing the square create vertex form?
+Vertex form is written as \(a(x-h)^2+k\). When you complete the square on an expression, you build the \((x-h)^2\) portion mathematically. The leftover constants combine outside the parentheses to give you the exact \(k\) value.
Why is there a \(\pm\) after taking a square root?
+Squaring hides a sign: \(5^2=25\) and \((-5)^2=25\). Therefore, if \(u^2=25\), then \(u=5\) or \(u=-5\). The \(\pm\) records both possible values.
Can every quadratic equation be solved by completing the square?
+Yes, completing the square can solve quadratic equations when complex-number solutions are allowed. Over the real numbers, an equation may have no solution if completing the square produces \((x-h)^2=k\) with \(k<0\). The method applies to quadratics, not arbitrary higher-degree polynomials.
Ready to Work Through One?
+Enter your quadratic above, choose step-by-step answers, and follow each transformation from standard form to a completed square before using the result.