Completing the Square Calculator
Use this completing the square calculator to rewrite a quadratic expression from standard form \(ax^2+bx+c\) into vertex form \(a(x-h)^2+k\). Enter the coefficients \(a\), \(b\), and \(c\), and the tool will show the completed-square form, the vertex, the axis of symmetry, the minimum or maximum value, and clear algebraic steps.
Complete the Square Online
Enter a quadratic expression in standard form. The calculator assumes the expression is \(f(x)=ax^2+bx+c\), where \(a\neq0\). It then computes \(h=-\frac{b}{2a}\) and \(k=c-\frac{b^2}{4a}\), so the final result is written as \(f(x)=a(x-h)^2+k\).
Example input: for \(2x^2-12x+7\), enter \(a=2\), \(b=-12\), and \(c=7\).
Click the button to see the completed-square form and the step-by-step transformation.
What Completing the Square Means
Completing the square is an algebra method used to rewrite a quadratic expression so that a hidden perfect square becomes visible. A quadratic in standard form, \(ax^2+bx+c\), is often useful for expanding, collecting terms, and applying the quadratic formula. However, standard form does not immediately show the turning point of the parabola. Completing the square changes the same expression into vertex form, \(a(x-h)^2+k\), where the vertex is \((h,k)\). This form is especially powerful because it reveals the graph’s center of symmetry and the minimum or maximum value without needing to sketch the entire curve.
The phrase “complete the square” comes from the pattern \(x^2+2px+p^2=(x+p)^2\). The first two terms, \(x^2+2px\), are not enough to create a perfect square trinomial. The missing term is \(p^2\). When you add the correct square term, the expression can be factored as a binomial squared. In a simple example, \(x^2+6x\) becomes \(x^2+6x+9=(x+3)^2\), because half of \(6\) is \(3\), and \(3^2=9\). If the original expression also contains a constant, you must keep the expression balanced by subtracting the same value that you add.
For a quadratic with leading coefficient \(a=1\), the process is relatively direct. For example, \(x^2+8x+5\) becomes \((x+4)^2-16+5\), which simplifies to \((x+4)^2-11\). For a quadratic with \(a\neq1\), the process requires one extra layer of care. You should first factor \(a\) from the \(x^2\) and \(x\) terms, complete the square inside the bracket, and then distribute the effect of \(a\) correctly. This is where many student errors happen: if you add a number inside parentheses that are multiplied by \(a\), the outside value changes by \(a\) times that number, not just that number alone.
Completing the square is more than a classroom trick. It connects algebra, graphing, equations, optimization, and calculus. In graphing, it finds the vertex. In solving equations, it leads to the quadratic formula. In coordinate geometry, it rewrites circle and ellipse equations into standard form. In calculus, it helps transform quadratic expressions inside integrals. That is why a completing the square calculator should do more than output an answer; it should show the structure of the transformation so that the user understands why the result is equivalent to the original expression.
Completing the Square Formula and Variable Meanings
For the quadratic expression \(f(x)=ax^2+bx+c\), where \(a\neq0\), the completed-square form is:
This is equivalent to the vertex form:
- \(a\) is the coefficient of \(x^2\). It controls the vertical stretch or compression of the parabola and whether it opens upward or downward.
- \(b\) is the coefficient of \(x\). Together with \(a\), it controls the horizontal location of the vertex.
- \(c\) is the constant term. It is the \(y\)-intercept of the graph \(y=ax^2+bx+c\).
- \(h\) is the \(x\)-coordinate of the vertex, found using \(h=-\frac{b}{2a}\).
- \(k\) is the \(y\)-coordinate of the vertex, found by substituting \(h\) into the function or using \(k=c-\frac{b^2}{4a}\).
The calculator uses these formulas directly. It also explains the bracket method because that is the method most students are expected to show in algebra, precalculus, GCSE, IGCSE, SAT, IB, and AP-style work. Formula shortcuts are useful, but the step-by-step transformation is what builds understanding.
How to Complete the Square Step by Step
To complete the square for \(ax^2+bx+c\), use the following method. This is the same process implemented in the calculator above.
- Check that \(a\neq0\). If \(a=0\), the expression is linear, not quadratic, so completing the square does not apply.
- Factor \(a\) from the \(x^2\) and \(x\) terms:
\[ ax^2+bx+c=a\left(x^2+\frac{b}{a}x\right)+c \]
- Take half of the coefficient of \(x\) inside the bracket. The coefficient is \(\frac{b}{a}\), so half is:
\[ \frac{1}{2}\cdot\frac{b}{a}=\frac{b}{2a} \]
- Square that half-coefficient:
\[ \left(\frac{b}{2a}\right)^2=\frac{b^2}{4a^2} \]
- Add and subtract that square inside the bracket:
\[ a\left(x^2+\frac{b}{a}x+\frac{b^2}{4a^2}-\frac{b^2}{4a^2}\right)+c \]
- Factor the first three terms as a perfect square:
\[ a\left[\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a^2}\right]+c \]
- Distribute \(a\) over the subtracted part and simplify:
\[ a\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a}+c \]
- Write the final completed-square form:
\[ a\left(x+\frac{b}{2a}\right)^2+\left(c-\frac{b^2}{4a}\right) \]
Notice the most important balancing idea: the square is added inside a bracket that is multiplied by \(a\). Therefore, the amount subtracted outside after simplification becomes \(\frac{b^2}{4a}\), not \(\frac{b^2}{4a^2}\). This difference is subtle but essential.
Worked Examples
Example 1: \(a=1\)
Complete the square for:
Half of \(10\) is \(5\), and \(5^2=25\). Add and subtract \(25\):
So the vertex form is \(f(x)=(x+5)^2-18\), and the vertex is \((-5,-18)\).
Example 2: \(a\neq1\)
Complete the square for:
Factor out \(2\) from the first two terms:
Half of \(-6\) is \(-3\), and \((-3)^2=9\):
The vertex is \((3,-11)\). Since \(a=2>0\), the parabola opens upward and has a minimum value of \(-11\).
Example 3: Negative leading coefficient
Complete the square for:
Factor out \(-1\) from the first two terms:
Half of \(-6\) is \(-3\), and \((-3)^2=9\):
The vertex is \((3,5)\). Because \(a<0\), the parabola opens downward and has a maximum value of \(5\).
Example 4: Fractional result
Complete the square for:
Use the formula:
So:
Fractional answers are normal. They often mean the vertex does not land on integer grid coordinates.
Why Vertex Form Is Useful
Completing the square is often taught as a manipulation technique, but its real value is interpretive. Standard form \(ax^2+bx+c\) shows the \(y\)-intercept immediately, because when \(x=0\), \(f(0)=c\). It also gives a direct route to the discriminant \(b^2-4ac\), which tells you about roots. However, it hides the vertex. Vertex form \(a(x-h)^2+k\) does the opposite: it makes the vertex and the direction of opening obvious.
The term \((x-h)^2\) is always nonnegative for real \(x\). If \(a>0\), then \(a(x-h)^2\) is also nonnegative, so the smallest value of \(a(x-h)^2+k\) is \(k\). This happens at \(x=h\), where the squared term becomes zero. Therefore, if \(a>0\), the vertex \((h,k)\) is a minimum point. If \(a<0\), then \(a(x-h)^2\) is nonpositive, so the greatest value is \(k\), again at \(x=h\). Therefore, if \(a<0\), the vertex is a maximum point.
This interpretation makes vertex form extremely useful in optimization problems. If a question asks for the maximum height of a projectile, the minimum cost of a production model, the highest revenue under a quadratic model, or the lowest point of a parabolic arch, completing the square can reveal the answer quickly. It also helps with transformations of graphs. In \(a(x-h)^2+k\), the graph of \(y=x^2\) shifts right by \(h\), up by \(k\), and is stretched, compressed, or reflected according to \(a\).
For students, completing the square is a bridge between algebraic manipulation and graphical reasoning. It shows that the same expression can communicate different information depending on the form. Standard form, factored form, and vertex form are not competing answers; they are different windows into the same quadratic relationship.
Comparing Standard Form, Vertex Form, and Factored Form
| Form | General structure | What it reveals fastest | When it is useful |
|---|---|---|---|
| Standard form | \(ax^2+bx+c\) | The \(y\)-intercept \(c\), coefficient pattern, and discriminant | Expansion, collecting terms, using the quadratic formula, and identifying coefficients |
| Vertex form | \(a(x-h)^2+k\) | The vertex \((h,k)\), axis \(x=h\), and minimum or maximum value | Graphing, transformations, optimization, and interpreting turning points |
| Factored form | \(a(x-r_1)(x-r_2)\) | The roots or \(x\)-intercepts \(r_1\) and \(r_2\) | Solving equations, sign charts, and intercept-based graphing |
A strong quadratic solver should help you move between these forms. If you need roots, factored form may be most useful. If you need a turning point, completing the square is usually the most direct method. If you need to combine or compare expressions, standard form may be easiest. For more practice with related quadratic ideas, explore the Num8ers quadratics guide, the polynomial expressions guide, and the nonlinear inequalities guide.
Common Mistakes When Completing the Square
- Forgetting to factor out \(a\). If \(a\neq1\), the coefficient of \(x^2\) inside the bracket must be \(1\) before completing the square.
- Using \(\frac{b}{2}\) instead of \(\frac{b}{2a}\). The half-coefficient inside the bracket is based on \(\frac{b}{a}\), not always on \(b\) itself.
- Forgetting the outside multiplier. Adding and subtracting inside a bracket multiplied by \(a\) affects the outside constant by \(a\) times the added amount.
- Losing a negative sign. Negative leading coefficients and negative \(b\)-values require careful bracket handling.
- Confusing \(x+\frac{b}{2a}\) with \(x-h\). Since \(h=-\frac{b}{2a}\), the signs in vertex form can look reversed.
- Assuming every vertex is a minimum. If \(a<0\), the parabola opens downward and the vertex is a maximum.
- Writing a non-equivalent expression. Every step must preserve the original value of the quadratic.
The best way to avoid these mistakes is to expand your final vertex form and check that it returns the original standard form. For example, if you claim \(2x^2-12x+7=2(x-3)^2-11\), expand the right side: \(2(x^2-6x+9)-11=2x^2-12x+18-11=2x^2-12x+7\). The match confirms that the completed-square form is correct.
How This Calculator Works
This calculator follows a transparent algebra process. First, it checks that the three inputs are valid numbers and that \(a\neq0\). Then it computes the vertex coordinate:
Next, it computes the corresponding \(y\)-value:
This value is equivalent to:
Finally, the calculator displays the completed-square form:
The tool also computes the discriminant \(\Delta=b^2-4ac\), because it helps interpret the relationship between the vertex and the roots. If \(\Delta>0\), the quadratic has two real roots. If \(\Delta=0\), the vertex lies on the \(x\)-axis and there is one repeated real root. If \(\Delta<0\), the graph does not cross the \(x\)-axis and the real roots do not exist. This extra information makes the result more useful when you are also solving quadratic equations.
Completing the Square in Equation Solving
Completing the square is also a method for solving quadratic equations. Suppose you want to solve:
After completing the square, you get:
Then isolate the squared term:
Taking square roots gives:
This process is one way to derive the quadratic formula. Starting from \(ax^2+bx+c=0\), divide by \(a\), move the constant term, complete the square, and solve. The result becomes:
This connection matters because it shows that the quadratic formula is not random. It is the general result of completing the square for any quadratic equation. Understanding that connection makes the formula easier to remember and easier to use correctly.
When Students Should Use Completing the Square
Completing the square is most useful when a question asks for information that is naturally connected to the vertex of a quadratic. If a task asks for the turning point, axis of symmetry, maximum value, minimum value, range, transformation, or graph shape, vertex form is usually the best target form. Standard form can still answer many of those questions, but it often requires extra formulas or substitutions. Completing the square reorganizes the expression so that the key information is visible at a glance.
Use completing the square when you see wording such as “write in vertex form,” “find the turning point,” “show the minimum value,” “determine the maximum height,” “describe the transformation,” or “solve by completing the square.” These phrases all point toward the same algebraic structure. The method is also valuable when a quadratic does not factor neatly. Factoring is fast when integer factors exist, but not every quadratic has convenient factors. Completing the square still works for any quadratic expression where \(a\neq0\), even when the roots are irrational or complex.
In graphing questions, completing the square helps you avoid guessing. For \(f(x)=a(x-h)^2+k\), the graph is a transformed version of \(y=x^2\). The value \(h\) controls the horizontal shift, \(k\) controls the vertical shift, and \(a\) controls reflection and stretch. If \(a\) is positive, the parabola opens upward. If \(a\) is negative, the parabola opens downward. If \(|a|>1\), the graph is narrower than \(y=x^2\). If \(0<|a|<1\), the graph is wider. This makes vertex form a direct graphing form, not just an algebra form.
In equation-solving questions, completing the square becomes especially helpful when a teacher, exam, or textbook specifically asks students to avoid the quadratic formula. The method shows the logic behind square roots and the plus-minus sign. For example, if \(x^2+6x+1=0\), completing the square gives \((x+3)^2-8=0\), so \((x+3)^2=8\), and \(x=-3\pm2\sqrt{2}\). This answer is exact, and it also gives insight into why there are two roots. The square can equal the same positive value from a positive or negative input.
Completing the square is also important in advanced mathematics. In coordinate geometry, equations such as \(x^2+y^2+6x-4y-12=0\) are rewritten by completing the square in both \(x\) and \(y\), revealing the center and radius of a circle. In calculus, quadratics in denominators are often completed to match inverse trigonometric integral patterns. In statistics and probability, completing the square appears in derivations involving normal distributions. The classroom algebra skill therefore becomes a reusable mathematical tool across many subjects.
How to Check Your Answer
The safest way to check a completed-square answer is to expand it. If the expanded result matches the original quadratic exactly, the answer is correct. Suppose the calculator gives \(2(x-3)^2-11\). Expand the square first:
Then distribute and combine constants:
Because this equals the original expression, the completed-square form is correct. This expansion check is simple but very powerful. It catches sign errors, missing brackets, incorrect constant adjustments, and mistakes caused by forgetting the leading coefficient.
You can also check the vertex numerically. In vertex form \(a(x-h)^2+k\), substituting \(x=h\) should give \(k\), because the squared term becomes zero. If your completed-square form says \(f(x)=3\left(x+\frac{5}{6}\right)^2-\frac{49}{12}\), then the vertex occurs when \(x+\frac{5}{6}=0\), which means \(x=-\frac{5}{6}\). Substituting that value into the original expression should produce \(-\frac{49}{12}\). If it does not, something went wrong in the calculation.
Another check uses symmetry. A quadratic graph is symmetric about its axis \(x=h\). If two \(x\)-values are the same distance from \(h\), their function values should be equal. For example, if the vertex has \(h=3\), then \(x=2\) and \(x=4\) are both one unit away from the axis. A correct quadratic expression should give the same output for those two inputs after the vertex shift is accounted for. This can be a useful graphing check when you are making a table of values.
Finally, compare the discriminant with the vertex position. If \(a>0\) and \(k>0\), the parabola opens upward and its lowest point is above the \(x\)-axis, so it should have no real roots. If \(a>0\) and \(k=0\), the vertex touches the \(x\)-axis, so there is one repeated root. If \(a>0\) and \(k<0\), the graph crosses the \(x\)-axis twice, so there are two real roots. A similar interpretation works for \(a<0\), but the graph opens downward. This relationship helps students connect algebraic results with the shape of the graph.
Classroom and Exam Tips
When writing completing-the-square solutions by hand, show enough work for each transformation to be traceable. Many students lose marks not because their final answer is wrong, but because their balancing step is unclear. A good solution should show the original quadratic, the factor-out step if \(a\neq1\), the half-and-square calculation, the add-and-subtract step, the perfect square factorization, and the final simplified vertex form. This makes the answer easier for a teacher or examiner to follow.
Keep brackets visible, especially when \(a\neq1\) or \(a<0\). For example, in \(-2x^2+8x-1\), you should write \(-2(x^2-4x)-1\) before completing the square. If you complete the square as though the leading coefficient were \(1\), the constant adjustment will be wrong. The negative sign outside the bracket also changes the direction of the adjustment when you simplify. Clear brackets reduce the chance of losing a sign.
Do not round too early. If a value such as \(h=-\frac{5}{6}\) appears, keep it as an exact fraction in your written work when possible. Decimal approximations can be useful for graphing, but exact values are usually preferred in algebra. Rounding too early can make your final vertex form slightly inaccurate, especially when the coefficients are fractions or the quadratic appears inside another calculation.
Use the identity \((x+p)^2=x^2+2px+p^2\) as a mental guide. The middle coefficient is always twice the number inside the bracket. If your completed square is \((x+4)^2\), the middle term should be \(8x\), not \(4x\). If your completed square is \((x-7)^2\), the middle term should be \(-14x\). This quick check catches many half-coefficient mistakes.
In exam settings, also pay attention to the requested form. Some questions want \(a(x-h)^2+k\). Others accept \(a\left(x+\frac{b}{2a}\right)^2+\left(c-\frac{b^2}{4a}\right)\). Some ask for the vertex only. Some ask to solve an equation after completing the square. Read the final instruction carefully so that you do not stop too early. The calculator above gives multiple pieces of information because different problems use the same method for different goals.
Practice Problems
Try completing the square by hand before using the calculator. Then enter the coefficients to check your work.
| Problem | Hint | Final vertex form |
|---|---|---|
| \(x^2+12x+20\) | Half of \(12\) is \(6\), and \(6^2=36\). | \((x+6)^2-16\) |
| \(x^2-4x+9\) | Half of \(-4\) is \(-2\), and \((-2)^2=4\). | \((x-2)^2+5\) |
| \(3x^2-18x+11\) | Factor out \(3\) first: \(3(x^2-6x)+11\). | \(3(x-3)^2-16\) |
| \(-2x^2+16x-5\) | Factor out \(-2\) first: \(-2(x^2-8x)-5\). | \(-2(x-4)^2+27\) |
| \(4x^2+8x+1\) | Use \(h=-\frac{b}{2a}=-1\). | \(4(x+1)^2-3\) |
For each problem, expand the final vertex form to confirm that it matches the original expression. This habit builds accuracy and makes completing the square feel less like memorization. Over time, you will start recognizing the perfect-square adjustment quickly.
FAQ
What does completing the square do?
Completing the square rewrites a quadratic expression from standard form \(ax^2+bx+c\) into vertex form \(a(x-h)^2+k\). This makes the vertex, axis of symmetry, and minimum or maximum value easier to identify.
What is the formula for completing the square?
The general formula is \(ax^2+bx+c=a\left(x+\frac{b}{2a}\right)^2+\left(c-\frac{b^2}{4a}\right)\), where \(a\neq0\).
How do I find the vertex after completing the square?
In vertex form \(a(x-h)^2+k\), the vertex is \((h,k)\). For \(ax^2+bx+c\), \(h=-\frac{b}{2a}\) and \(k=c-\frac{b^2}{4a}\).
Can completing the square solve quadratic equations?
Yes. After rewriting the quadratic as \(a(x-h)^2+k=0\), isolate the squared term and take square roots. This method also leads to the quadratic formula.
Why do I factor out \(a\) first?
You factor out \(a\) because the perfect square pattern requires the coefficient of \(x^2\) inside the bracket to be \(1\). If you skip this step when \(a\neq1\), the square term is usually calculated incorrectly.
Is vertex form the same as completed-square form?
Yes. Completed-square form is usually written as vertex form, \(a(x-h)^2+k\). It is called vertex form because it directly shows the vertex \((h,k)\).
Related Num8ers Resources
Use these related guides to continue studying quadratics, polynomial expressions, and algebraic methods.