Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Number to Complete the Square (b/2)²
9
add this constant to x² + bx
Coefficient b 6
b / 2 3
(b/2)² to add 9
Perfect square form (x + 3)²

What This Calculator Does

Completing the square is a core algebra technique for solving quadratic equations, graphing parabolas, and deriving the quadratic formula. For an expression of the form x² + bx, you complete the square by adding a specific constant: \((b/2)^2\). This calculator takes your coefficient b and instantly returns that constant, along with b/2 and the resulting perfect-square form.

How to Use It

Identify the coefficient of the linear (x) term in an expression already written as x² + bx. Enter that value as b — it can be positive, negative, or a decimal. The calculator returns the number \((b/2)^2\) you should add, and shows the factored form \((x + b/2)^2\).

The Formula Explained

A perfect square trinomial looks like \((x + k)^2 = x^2 + 2kx + k^2\). Comparing \(x^2 + bx\) to \(x^2 + 2kx\) tells us that \(2k = b\), so \(k = b/2\). The missing constant is therefore $$\text{Term} = \left(\frac{\text{Coefficient }b}{2}\right)^{2}$$ Adding it makes the expression an exact square: $$x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2$$

Square diagram split into an x-by-x square, two b/2 rectangles, and a missing corner square
Geometric view: the missing corner square has area \((b/2)^2\), the number that completes the square.

Worked Example

Suppose you have \(x^2 + 6x\). Here \(b = 6\), so \(b/2 = 3\) and \((b/2)^2 = 9\). Adding 9 gives $$x^2 + 6x + 9 = (x + 3)^2$$ If you started with the equation \(x^2 + 6x = 5\), you would add 9 to both sides: \((x + 3)^2 = 14\), then solve \(x = -3 \pm \sqrt{14}\).

Three-step flow from x squared plus bx to half of b to its square forming a perfect square
The process: halve b, then square it to get the constant added.

FAQ

What if the x² term has a coefficient other than 1? First factor or divide so the leading coefficient is 1 (e.g. \(2x^2 + 8x = 2(x^2 + 4x)\)), then complete the square on the inside \(x^2 + 4x\).

Does it work with a negative b? Yes. Squaring removes the sign, so \((b/2)^2\) is always non-negative. For \(x^2 - 8x\), \(b = -8\), \(b/2 = -4\), and you add 16.

What about fractions? Decimals and fractions work fine; for \(x^2 + 3x\) you add \((1.5)^2 = 2.25\).

Last updated: