Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Completing the Square


Enter coefficients
x2+x+= 0
Try a preset
Geometric Picture
6x5
Starting equation. Three terms: an x² piece, a 6x piece, and the constant 5. We will arrange them into a geometric square to read off the vertex form.
Step-by-step solution
1Starting equation
Three terms: an x² piece, a 6x piece, and the constant 5. We will arrange them into a geometric square to read off the vertex form.
x² + 6x + 5 = 0
2Place the x² square
Start with a square of side x. Its area is x².
x² + 6x + 5
3Split the 6x rectangle
Half of 6 is 3. Split the 6x rectangle into two equal strips of size x × 3. Place one to the right of the square and one below.
x² + 2·(3·x) + 5
4Move the constant 5 into the corner
The bottom-right corner has dimensions 3 × 3 = 9. The constant 5 sits inside this corner, but only partially fills it.
(x² + 2·(3·x)) + 5
5Gap of 4
The corner needs area 9 to complete the square. The constant 5 fills part of it; the gap is 9 − 5 = 4. So the original expression is 4 less than the completed square.
Inside parentheses: (x + 3)² − 4
6Vertex form
Combine the pieces: x² + 6x + 5 = (x + 3)² − 4.
(x + 3)² − 4 = 0
7Solve for x
Move the constant to the right side and take the square root.
x = -3 ± 2 ≈ -1 or -5
Vertex form
y = (x + 3 4
Vertex: (-3, -4)
















Key Terms

Completing the square — a technique for rewriting a quadratic expression ax2+bx+cax^2 + bx + c as a(xh)2+ka(x - h)^2 + k, a perfect square plus a constant. Used to derive the vertex form, solve quadratics, and prove the quadratic formula.

Vertex form — the rewriting y=a(xh)2+ky = a(x - h)^2 + k of a quadratic, in which the vertex of the parabola sits at the point (h,k)(h, k).

Perfect square trinomial — a trinomial of the form x2+2px+p2x^2 + 2px + p^2 that factors as (x+p)2(x + p)^2. Completing the square produces exactly this pattern inside the parentheses.

The $(b/2)^2$ rule — for the monic case x2+bx+cx^2 + bx + c, the constant needed to complete the square is (b/2)2(b/2)^2. Geometrically, this is the area of the corner that turns the two half-strips into a full square.

Vertex — the turning point of a parabola: (h,k)(h, k) in vertex form. The minimum (if a>0a > 0) or maximum (if a<0a < 0) point of the quadratic.

Discriminant connection — the constant adjustment after completing the square is cb2/(4a)c - b^2/(4a), which leads directly to the quadratic formula and the discriminant b24acb^2 - 4ac.

Getting Started

The tool opens with x2+6x+5=0x^2 + 6x + 5 = 0 loaded as a default. You see:

• A coefficient row at the top with three number inputs labeled ax2+bx+c=0ax^2 + bx + c = 0.

• A row of preset quadratics below the inputs for quick exploration.

• A geometric picture that animates a square being built piece by piece.

• A step-by-step solution panel on the right with every step rendered at once; the current step is highlighted, the others are faded.

To explore:

• Edit any of the three coefficient inputs to change the quadratic.

• Click a preset button to load a curated example.

• Press Next or the auto-play button to advance through the stages.

• Click any step on the right panel to jump the diagram back to that stage.

The final box at the bottom of the right panel always shows the resulting vertex form and the coordinates of the vertex.

Entering Coefficients

The blue input row at the top is where you set the quadratic. Three editable fields for aa, bb, and cc in the standard form ax2+bx+c=0ax^2 + bx + c = 0:

$a$ — the leading coefficient. Defaults to 11. The tool handles any nonzero value, including negative numbers and decimals. If a1a \neq 1, an extra step appears that factors aa out of the x2x^2 and xx terms.

$b$ — the linear coefficient. This is the value that gets halved to find the side of the strips. The geometric diagram splits the bxbx rectangle into two equal strips of size x×b/2x \times b/2.

$c$ — the constant. This is the value placed into the bottom-right corner of the partial square. Whether the corner is exactly filled, partially filled (gap), or overflowed (excess) depends on how cc compares to (b/2)2(b/2)^2.

Edits update the diagram and the step list immediately. There is no apply button.

Presets

Five preset buttons below the input row load curated quadratics chosen to show different cases of the completing-the-square procedure:

$x^2 + 6x + 5$ — the default. Monic, positive bb, the constant is less than (b/2)2=9(b/2)^2 = 9, so the diagram shows a gap.

$2x^2 + 8x + 3$ — non-monic. Triggers the extra step that factors out 22 from the xx terms.

$x^2 - 4x + 1$ — negative bb. The half-strips are oriented the same way; the sign appears in the final (x2)2(x - 2)^2 form.

$x^2 + 5x + 2$ — fractional b/2=2.5b/2 = 2.5. Demonstrates that the method works for non-integer halves.

$3x^2 + 12x + 7$ — non-monic with positive leading coefficient. Combines factoring and a non-trivial gap.

Click any preset to load it; the inputs, diagram, and step list all refresh.

The Geometric Diagram

The left-side Geometric Picture card animates the construction stage by stage. Each stage shows a different state of the square-in-progress:

Start — three separate pieces appear side by side: a blue x2x^2 square, an orange bxbx rectangle, and a green or red constant block for cc.

Factor out $a$ (only when a1a \neq 1) — a text card noting that the rest of the work happens on the monic part; the aa is restored at the end.

Place the $x^2$ square — the blue square is positioned alone with both sides labeled xx.

Split the $bx$ rectangle — the orange rectangle is divided into two equal strips of width b/2b/2 and length xx, one placed to the right of the square and one below.

Drop $c$ into the corner — the green block lands in the bottom-right corner where the two strips meet. A leader line points to a label noting that the corner needs (b/2)×(b/2)=(b/2)2(b/2) \times (b/2) = (b/2)^2 to be complete.

The gap or excess — if c<(b/2)2c < (b/2)^2, a pulsing red block highlights the missing area equal to (b/2)2c(b/2)^2 - c. If c>(b/2)2c > (b/2)^2, an overflow note appears instead.

Complete the square — the full (x+b/2)×(x+b/2)(x + b/2) \times (x + b/2) square is shown with dimension bars on the outside and the final vertex-form equation below.

The Step-by-Step Panel

The right pane lists every step of the solution at once. Each step has:

• A number in a blue circle on the left.

• A title like *Split the bx rectangle* or *Vertex form*.

• A short explanation of what is happening at this stage and why.

• A boxed math line showing the algebraic form of the expression at this stage.

The current step is fully visible with a thicker blue accent stripe; the other steps are faded and slightly blurred so the focus stays on what is happening now. The right pane auto-scrolls to keep the current step centered.

Clicking any step jumps both the diagram and the panel back to that stage. This makes it easy to scrub through the procedure: load a preset, click around the steps, study the geometric meaning of each algebraic move.

Animation Controls

Below the diagram, a strip of controls drives the animation:

← Back — go to the previous step. Disabled at the first step.

Next → — advance one step. Becomes Done &check; at the last step.

▶ Play / ⏸ Pause — auto-advance through every step. The autoplay interval is about 2.4 seconds per step. Hitting Play after Done restarts from step 1.

↺ Restart — reset to step 1 without losing the current quadratic.

Progress pips — one tick per step. The current pip is highlighted blue and stretched wider; completed pips are lighter blue. Click any pip to jump directly to that step.

The controls don&apos;t affect the coefficients — only which step is being shown. Changing the coefficients automatically resets to step 1 and stops any autoplay.

The Vertex Form Box

At the bottom of the right pane, a blue gradient box always displays the final vertex form for the current quadratic:

y=a(xh)2+ky = a(x - h)^2 + k


with the vertex coordinates (h,k)(h, k) shown in yellow accent text below. This box is faded until you reach the last step, then it activates at full opacity to mark completion.

What the numbers mean for the original parabola:

$h$ is the xx-coordinate of the vertex: the value of xx where the parabola turns around.

$k$ is the yy-coordinate of the vertex: the minimum value of the quadratic if a>0a > 0, the maximum if a<0a < 0.

$a$ controls the width and direction: positive aa opens upward, negative aa opens downward, larger a|a| makes a narrower parabola.

For solving the equation ax2+bx+c=0ax^2 + bx + c = 0, set the vertex form to zero and isolate xx, which gives x=h±k/ax = h \pm \sqrt{-k/a} when k/a0-k/a \geq 0.

What Is Completing the Square

Completing the square is a technique for rewriting a quadratic expression so it contains an explicit perfect square. The general transformation is:

ax2+bx+c=a(x+b2a)2+cb24aax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 + c - \frac{b^2}{4a}


The geometric intuition the tool visualizes: think of x2x^2 as a square with side xx, and bxbx as a rectangle with sides xx and bb. Cut the rectangle into two equal strips of width b/2b/2, place one to the right of the square and one below. The figure is almost a larger square of side x+b/2x + b/2 — it&apos;s missing one small corner of area (b/2)2(b/2)^2. Adding and subtracting (b/2)2(b/2)^2 completes the picture.

Completing the square is the foundation of the quadratic formula: applying the procedure to the general ax2+bx+c=0ax^2 + bx + c = 0 produces x=b±b24ac2ax = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} in a few algebraic steps.

For deeper coverage, see the completing the square section in the quadratics theory pages.

The (b/2)^2 Step

The central trick of the method is adding (b/2)2(b/2)^2 to complete the square inside the parentheses. Why this specific number?

Compare x2+bx+?x^2 + bx + ? to the expansion (x+p)2=x2+2px+p2(x + p)^2 = x^2 + 2px + p^2. Matching the linear terms: 2p=b2p = b, so p=b/2p = b/2. Matching the constant: the constant must be p2=(b/2)2p^2 = (b/2)^2.

So (b/2)2(b/2)^2 is the unique value that makes the trinomial a perfect square. If the original expression has a different constant cc, you account for the gap or excess:

x2+bx+c=(x+b2)2+(cb24)x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 + \left(c - \frac{b^2}{4}\right)


For the general ax2+bx+cax^2 + bx + c, first factor aa out of the x2x^2 and xx terms to get a monic expression inside parentheses, complete the square there, then redistribute. The constant adjustment becomes cb2/(4a)c - b^2/(4a), which is exactly the yy-coordinate of the parabola&apos;s vertex.

Related Concepts

Quadratic formula — derived directly by completing the square on the general ax2+bx+c=0ax^2 + bx + c = 0. Gives the roots x=b±b24ac2ax = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

Discriminant — the expression b24acb^2 - 4ac that appears under the square root in the quadratic formula. Determines whether the roots are real and distinct, repeated, or complex.

Vertex form — the rewriting y=a(xh)2+ky = a(x - h)^2 + k that completing the square produces. Makes the vertex and axis of symmetry immediately readable.

Standard form — the alternative y=ax2+bx+cy = ax^2 + bx + c. Useful for identifying intercepts and applying the quadratic formula, less convenient for graphing the vertex.

Factored formy=a(xr1)(xr2)y = a(x - r_1)(x - r_2), where r1r_1 and r2r_2 are the roots. Useful when the quadratic factors over the rationals; not always available.

Parabola — the graph of a quadratic. The vertex form makes its shape, vertex, and orientation directly visible.

Algebra calculator — for symbolic completion of the square on more complex expressions, see the dedicated completing the square calculator in the algebra calculators section.