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.
Terms are areas: x2x^2 a square, bxbx a rectangle, cc a block — and the whole method is rearrangement without loss. Learn more about the starting equation · All steps
The all-integer reference: gap 44, roots 1-1 and 5-5, factoring cross-check available. Learn more about the default quadratic · All presets
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(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:

aa — 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.

bb — 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.

cc — 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:

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

2x2+8x+32x^2 + 8x + 3 — non-monic, with a leading coefficient of two. Triggers the extra step that factors out 22 from the xx terms.

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

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

3x2+12x+73x^2 + 12x + 7 — non-monic, with a leading coefficient of three. Combines factoring and a non-trivial gap.

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

The Default Quadratic

x2+6x+5x^2 + 6x + 5, frozen at its gap frame: strips of width 33, a corner needing 99, a constant of 55, and a red gap of 44.
3x3x5gap = 4x3x3
x² + 6x + 5, frozen at the gap

The reference preset: all integers, gap 4 a perfect square, roots −1 and −5 whole. Maximum legibility.

The default is chosen to be maximally legible: monic, everything integer, and a gap that is a perfect square, so the roots come out whole (1-1 and 5-5). It is the configuration every step section on this page freezes, which makes it the reference thread — read the step sequence with these numbers in mind and every frame belongs to one continuous story.

As a factoring cross-check: x2+6x+5=(x+1)(x+5)x^2 + 6x + 5 = (x+1)(x+5), confirming the roots the square-completion finds. When both methods are available, they must agree — a useful habit of verification the tool makes cheap.

A Leading Coefficient of Two

2x2+8x+32x^2 + 8x + 3, frozen at the gap stage of its monic part x2+4x+1.5x^2 + 4x + 1.5: strips of width 22, a corner needing 44, and a gap of 2.52.5.
2x2x1.5gap = 2.5x2x2
2x² + 8x + 3, frozen at the gap

The factor of 2 ripples through: working middle term 4, half 2, and a fractional constant 1.5 in the corner.

The non-monic preset shows the division rippling through every number: the working middle term is 8/2=48/2 = 4, the half is 22, and the constant becomes the fraction 1.51.5 — integer inputs do not guarantee integer geometry once aa is factored out.

The finish restores the factor: 2(x+2)252(x + 2)^2 - 5, so the vertex is (2,5)(-2, -5) and the gap seen in the frame gets scaled by aa on the way back. That final multiplication is the step most often forgotten in hand calculations; the tool performs it as its own titled move — see the factoring step for the opening half of the same bracket.

The Negative Middle Term

x24x+1x^2 - 4x + 1, frozen at its gap frame: half of 4-4 is 2-2, the strips carry the label 2x-2x, the corner needs 44, and the gap is 33.
-2x-2x1gap = 3x-2x-2
x² − 4x + 1, frozen at the gap

Negative b lives in the labels (−2x strips), not the geometry — and resurfaces as (x − 2)² in the result.

Geometry draws lengths positive, so the strips look the same as ever — the negative sign lives in the labels and re-emerges in the algebra as (x2)2(x - 2)^2. The picture is best read as an honest diagram of the magnitudes with the signs tracked symbolically, which is exactly how the tool renders it.

The result (x2)23=0(x-2)^2 - 3 = 0 gives x=2±3x = 2 \pm \sqrt{3} — the preset where the roots go irrational, a reminder that clean inputs promise nothing about outputs. The vertex (2,3)(2, -3) sits to the right of the axis: negative bb pushes the parabola's turning point in the positive direction.

The Fractional Half

x2+5x+2x^2 + 5x + 2, frozen at its gap frame: an odd middle coefficient makes the half 2.52.5, the corner 6.256.25, and the gap 4.254.25.
2.5x2.5x2gap = 4.25x2.5x2.5
x² + 5x + 2, frozen at the gap

The odd middle coefficient: strips of width 2.5, corner 6.25 — the halving trick indifferent to fractions.

The odd-bb preset retires a common suspicion — that the halving trick only works when bb is even. The geometry does not care: strips of width 2.52.5 extend the square exactly as well as integer ones, and the corner is simply 2.52=6.252.5^2 = 6.25.

The completed form (x+2.5)24.25(x + 2.5)^2 - 4.25 produces the roots 2.5±4.25-2.5 \pm \sqrt{4.25}. Fractions are precisely why completing the square is taught as a general method rather than a factoring shortcut: x2+5x+2x^2 + 5x + 2 has no rational factorization, yet the procedure never notices.

A Leading Coefficient of Three

3x2+12x+73x^2 + 12x + 7, frozen at the gap stage of its monic part x2+4x+7/3x^2 + 4x + 7/3: strips of width 22, a corner of 44, and a gap of 5/35/3 — drawn as its decimal 1.66671.6667.
2x2x2.3333gap = 1.6667x2x2
3x² + 12x + 7, frozen at the gap

Both complications at once: factor 3 out, constant 7/3 in — leaving the thinnest red sliver of the five presets.

The last preset compounds both complications: factoring out 33 and a fractional constant 7/37/3. The frame's proportions tell the story at a glance — the green block fills most of the corner, leaving a thin red sliver, the smallest gap of the five presets.

Restoring the factor gives 3(x+2)253(x + 2)^2 - 5, vertex (2,5)(-2, -5) — coincidentally the same vertex as the coefficient-two preset, reached by an entirely different quadratic. Two parabolas sharing a vertex but not a width: a closing illustration that aa alone controls the opening, while completing the square finds the turning point.

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² 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, ready for the solving step.

The Starting Equation

Step one lays the raw material side by side: the blue x2x^2 square, the orange 6x6x rectangle, and the green constant 55 — three algebraic terms drawn as three areas, not yet arranged into anything.
6x5
Step 1: starting equation, frozen

Three terms as three areas: the x² square, the 6x rectangle, the constant block. Nothing arranged yet — the raw material.

The frame establishes the tool's central translation: terms are areas. x2x^2 is literally a square of side xx, 6x6x a rectangle with sides 66 and xx, and the constant a block of fixed area. Everything the procedure does from here is rearrangement — no area is ever created or destroyed, which is why the algebra stays honest.

The color code set here persists through every later frame: blue for the square, orange for anything built from the xx-term, green for the constant, and — later — red for what is missing. Follow the colors and the algebra follows.

Factoring Out the Leading Coefficient

A step that only exists when a1a \neq 1 — frozen here from the preset 2x2+8x+32x^2 + 8x + 3. The card announces the move to the monic part x2+4xx^2 + 4x, with the factor of 22 set aside.
Working with the monic part:x² + 4x(factor of 2 restored at the end)
Factor-out step (2x² + 8x + 3), frozen

The non-monic interlude: work moves to the monic part x² + 4x, with the factor of 2 waiting outside until the end.

The geometric construction needs a plain x2x^2 square to build on, so a non-monic quadratic is first divided down: 2x2+8x2x^2 + 8x becomes 2(x2+4x)2(x^2 + 4x), and the picture works inside the parentheses. The factor waits outside and is restored in the final step — which is why this frame is deliberately text-only, a bookkeeping interlude between two geometric acts.

Note what changed and what did not: the working middle coefficient is now b/a=4b/a = 4, so all later half-splitting uses 22, not 44 — the halving happens after the factoring. Skipping this order is the classic non-monic error, and the tool structurally prevents it.

Placing the x² Square

The construction begins: a single blue square, sides labeled xx, area x2x^2. Nothing else on the canvas.
xx
Step 2: the x² square, frozen

The construction site: one blue square, both sides labeled x. Everything that follows grows it symmetrically.

Starting from the square alone makes the goal visible by its absence: the finished figure will be a larger square, and everything that follows is about growing this one symmetrically. The two labeled sides matter — both must grow by the same amount for the result to stay square.

This is also where the geometric method quietly commits to x>0x > 0 pictures: lengths are drawn positive. The algebra it encodes has no such restriction — a point the negative-bb preset returns to.

Splitting the bx Rectangle

The 6x6x rectangle is cut into two equal strips of size 3×x3 \times x, one laid along the square's right edge, one along its bottom. The figure is now an L-shape — a square with two arms.
3x3xx3x3
Step 3: splitting 6x, frozen

Two equal 3×x strips, right and below: the halving that makes the figure a near-square instead of a rectangle.

The split in half is the step where completing the square actually happens, conceptually: only an even division lets the two strips extend the square symmetrically in both directions. Any other cut would produce a rectangle, not a near-square. Half of 66 is 33, and that 33 is the number that will appear inside the parentheses of (x+3)2(x+3)^2.

Algebraically the frame reads x2+23xx^2 + 2 \cdot 3x — the rewriting of 6x6x as twice 3x3x that seems pointless on paper and is self-evident in the picture: two identical orange strips.

The Constant in the Corner

The dashed outline marks what the L-shape is missing: a 3×33 \times 3 corner. The green constant 55 is dropped into it — and visibly fails to fill it, since the corner needs area 99.
3x3x5corner needs3 × 3 = 9x3x3
Step 4: the constant in the corner, frozen

The dashed corner needs 3 × 3 = 9; the green 5 sits inside and visibly falls short. The mismatch is the next step’s subject.

This is the frame where the question of the whole method crystallizes: *does the constant complete the square?* The leader line does the arithmetic in place — the corner needs (b/2)2=9(b/2)^2 = 9 — while the green block supplies only 55. The mismatch is no failure; measuring it is precisely the next step.

The three possible answers (too little, too much, exactly right) are the three characters a quadratic can have here, and the presets cover them. For the default, the answer is "too little by 4" — see the gap step.

The Gap in the Corner

The red block makes the shortfall explicit: the corner needs 99, the constant gives 55, and the missing area — the gap — is 44. The near-square is complete except for this red rectangle.
3x3x5gap = 4x3x3
Step 5: the gap, frozen

The red block measures the shortfall: gap = 9 − 5 = 4. The expression is exactly 4 less than a perfect square.

The gap is the number the whole procedure was built to find: the original expression equals the completed square minus the gap, x2+6x+5=(x+3)24x^2 + 6x + 5 = (x+3)^2 - 4. In the live tool this block pulses; frozen here, it simply sits where the missing area is, labeled with its value.

Its sign carries the geometry of the parabola: a positive gap means the vertex lies below the xx-axis by exactly that amount (for monic quadratics, k=gapk = -\text{gap}), which is why the equation (x+3)2=4(x+3)^2 = 4 will have two real solutions. The overflow case — constant larger than the corner — flips every one of those statements.

Reading Off the Vertex Form

The finished figure: a full square of side x+3x + 3, dimension bars along both edges, the corner filled, and the equation below — (x+3)24=0(x + 3)^2 - 4 = 0.
3x3x54x +3x +3(x + 3)² − 4 = 0
Step 6: vertex form, frozen

Dimension bars read the side as x + 3, so the figure IS (x+3)² − 4 — the vertex form as a picture.

The dimension bars are the payoff of the whole construction: the big square's side is readable as x+3x + 3 directly from the picture, so its area is (x+3)2(x+3)^2 with no expansion needed. Subtract the red gap and the vertex form is simply what the figure says.

From here the vertex coordinates fall out: h=3h = -3 (the sign flips because the form is (xh)2(x - h)^2) and k=4k = -4. The tool's blue vertex box activates at this step with exactly those numbers — geometry and formula agreeing in public.

Solving for x

The final step keeps the completed-square picture and turns it into roots: move the 44 across, take square roots, and x=3±2x = -3 \pm 2 — the solutions 1-1 and 5-5.
3x3x54x +3x +3(x + 3)² − 4 = 0 → solve for x
Step 7: solving, frozen

The completed square turned into roots: (x+3)² = 4, so x = −3 ± 2 — the parabola’s symmetry made algebraic.

The solving step is deliberately anticlimactic — the hard work was geometric, and what remains is two lines of algebra on the vertex form: (x+3)2=4(x+3)^2 = 4, so x+3=±2x + 3 = \pm 2. The ±\pm is where the parabola's symmetry re-enters: two points at equal distance from the axis x=3x = -3.

The same two lines run in general as x=h±k/ax = h \pm \sqrt{-k/a}, and the sign of k/a-k/a decides everything: positive gives two roots, zero one repeated root, negative a complex pair — the tool prints the ii explicitly in that case. Completing the square doesn't just solve the equation; run on the general coefficients, it derives the quadratic formula, which is the deepest fact on this page.

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:

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

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

aa 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.