Perfect Square Trinomial Calculator
Enter the three coefficients of your trinomial to instantly find out whether it is a perfect square, and if so, see the factored binomial form with full working. Switch to the missing-term mode to complete a trinomial when one coefficient is unknown. Every result includes a step-by-step breakdown of the algebra so you can see exactly how the answer was reached.
Formula
Worked example
Is x² + 6x + 9 a perfect square? a = 1, b = 6, c = 9. Discriminant = 6² - 4(1)(9) = 36 - 36 = 0. Yes. d = √1 = 1, e = √9 = 3, b > 0, so factored form = (x + 3)². Check: (x + 3)² = x² + 6x + 9. Correct.
What is a perfect square trinomial?
A perfect square trinomial is a three-term polynomial that equals the square of a binomial. Specifically, ax² + bx + c is a perfect square trinomial if and only if its discriminant, b² - 4ac, equals zero. When that condition holds, the trinomial factors neatly into (dx + e)² or (dx - e)², where d = √a and e = √c. The sign of the binomial matches the sign of the middle coefficient b: positive b gives a plus sign, negative b gives a minus sign. Common examples are x² + 2x + 1 = (x + 1)², x² - 6x + 9 = (x - 3)², and 4x² + 12x + 9 = (2x + 3)².
The discriminant test: why b² - 4ac = 0?
The quadratic formula gives roots at x = (-b ± √(b² - 4ac)) / (2a). When b² - 4ac = 0 there is only one distinct root (a repeated or double root), meaning the parabola touches the x-axis at exactly one point. That double-root structure is precisely what makes the trinomial the square of a single linear factor. A positive discriminant means two distinct real roots (not a perfect square), and a negative discriminant means no real roots at all (also not a perfect square over the reals). So checking the discriminant is the fastest one-step test.
Finding a missing term to complete the square
The three coefficients of a perfect square trinomial are not independent: b² = 4ac always. This relationship lets you find any one coefficient from the other two. Given a and c, the middle term is b = 2√a × √c (two solutions: positive or negative). Given a and b, the constant term is c = b² / (4a). Given b and c, the leading coefficient is a = b² / (4c). These are the three formulas in the "Find missing term" mode of this calculator. The completing-the-square technique used to solve quadratic equations relies on this process: you add (b/2a)² to both sides to create a perfect square trinomial on the left, then take the square root.
Expanding and applying the identities
The two core identities are (px + q)² = p²x² + 2pqx + q² and (px - q)² = p²x² - 2pqx + q². Notice that the first and last terms are always non-negative perfect squares (p² and q²), while the middle term carries the sign. You can check a trinomial by hand in three steps: confirm that the first and last terms are perfect squares, take their square roots to get p and q, then verify that the middle term equals 2pq (or -2pq for the minus version). If all three checks pass, you have a perfect square trinomial. This identity appears throughout algebra in completing the square, conic sections (circle and ellipse equations), and the derivation of the quadratic formula itself.
Perfect square trinomial identities
| Pattern | Expanded form | Condition for perfect square |
|---|---|---|
| (px + q)² | p²x² + 2pqx + q² | b = +2pq, b² = 4ac |
| (px - q)² | p²x² - 2pqx + q² | b = -2pq, b² = 4ac |
| (x + q)² | x² + 2qx + q² | a = 1, c = q², b = 2q |
| (x - q)² | x² - 2qx + q² | a = 1, c = q², b = -2q |
| -(px + q)² | -p²x² - 2pqx - q² | a < 0, discriminant = 0 |
Key binomial-square patterns used in algebra. p and q are any real numbers.
Frequently asked questions
How do I know if a trinomial is a perfect square?
Compute the discriminant b² - 4ac. If the result is zero, the trinomial is a perfect square. You can also check manually: the first and last terms must each be perfect squares (their square roots must be rational), and the middle term must equal twice the product of those two square roots (positive or negative).
What is the formula for a perfect square trinomial?
The two patterns are (px + q)² = p²x² + 2pqx + q² and (px - q)² = p²x² - 2pqx + q². In terms of the standard coefficients a, b, c: a = p², c = q², and b = ±2pq. The discriminant condition b² - 4ac = 0 is equivalent to these patterns.
Can the leading coefficient a be negative?
Yes. A trinomial with a negative leading coefficient can still be written as a binomial square if you factor out a negative sign first: -p²x² - 2pqx - q² = -(px + q)². The discriminant test still applies: b² - 4ac = 0 catches these cases too, since a and c would both be negative, making 4ac positive.
What is the connection between perfect square trinomials and completing the square?
Completing the square is the process of rewriting a quadratic as a perfect square trinomial plus a constant. For ax² + bx + c, you add and subtract (b / (2√a))² to force the first three terms into the pattern p²x² + 2pqx + q². This technique is used to derive the quadratic formula, to convert conic equations to standard form, and to find the vertex of a parabola.
What are some examples of perfect square trinomials?
x² + 2x + 1 = (x + 1)²; x² - 4x + 4 = (x - 2)²; 9x² + 6x + 1 = (3x + 1)²; 4x² - 12x + 9 = (2x - 3)²; 25x² + 10x + 1 = (5x + 1)². In each case the discriminant b² - 4ac equals zero.
What if the discriminant is close to zero but not exactly zero?
Due to floating-point arithmetic, a computed discriminant may be a very small number like 1e-12 rather than exactly zero when the true values are perfect squares. This calculator uses a tolerance of 1e-9 to handle rounding in the check mode. When working by hand, use exact integer or fractional arithmetic to avoid this issue.
How do I find the missing middle term b?
Use the formula b = 2√a × √c, where a and c are the known first and last coefficients. Note this gives two answers: +2√a×√c and -2√a×√c, corresponding to (dx + e)² and (dx - e)² respectively. Both produce a perfect square trinomial. Select "Find middle term b" in this calculator to compute both.