A trinomial is a perfect square when a and c are both squares AND b is twice the product of their roots — all three, not two. x² + 6x + 9 passes: (x + 3)² = x² + 6x + 9. x² + 6x + 10 fails on one condition only — the constant needs to be 9 and is −1 away.
Three conditions, and any one of them can fail
a x² + bx + c is a perfect square exactly when a = p², c = q², and b = ±2pq. Three separate requirements, and a trinomial can fail any one of them while passing the other two — which is why a single yes-or-no is a poor answer.
x² + 6x + 9 passes all three: 1 = 1², 9 = 3², and 6 = 2×1×3. So it is (x + 3)².
x² + 6x + 10 fails only on the constant: 10 is not a perfect square. Everything else lines up, and the trinomial misses being one by exactly −1. x² + 5x + 4 fails only on the middle: both ends are squares — 1 and 4 — but b would have to be 4 and it is 5.
Why two square ends are not enough
This is the failure worth naming, because it looks like a pass. x² + 5x + 4 has 1 at the front and 4 at the back, both perfect squares, and it factors perfectly well — as (x + 1)(x + 4). It is simply not a square.
The middle term is what distinguishes a square from any other factorisation. (px + q)² expands to p²x² + 2pqx + q², and that 2pq is forced: it is not a free parameter. Two square ends fix p and q, and p and q then fix b. If the given b is anything else, the trinomial is not that square.
The tool reports this case separately from the others for that reason. “Not a perfect square” and “not a perfect square, but here is why and here is what it factors as” are different amounts of help.
The gap is exactly what completing the square adds
Given a and b, the constant that would make a perfect square is b²/4a. Not approximately — exactly, and it is the same number completing the square asks you to add.
x² + 6x + 10 wants 9 and has 10, a gap of −1. Completing the square on it means writing x² + 6x + 9 + 1, which is (x + 3)² + 1 — the square, plus the leftover. That leftover is the gap this page reports.
So the two topics are the same arithmetic read in opposite directions. This page asks “is the constant already right?”; the Completing the Square Calculator asks “what do I add to make it right, and what do I subtract to keep the expression unchanged?” The number in the middle is the same either way.
Take the common factor out first
2x² + 4x + 2 has a leading coefficient of 2, which is not a perfect square — and it is still 2(x + 1)². The test only works after the common factor comes out.
This is the case implementations most often get wrong. Testing 2 for squareness and reporting “no” is technically a true statement about the leading coefficient and a false answer to the question, because 2(x + 1)² is the factorisation and it is a perfectly ordinary exam answer.
4x² + 12x + 9 is the other shape: a leading coefficient of 4 that is a square, so it needs no factoring out and comes to (2x + 3)². Both are handled, and the tool says which route it took.
A negative constant is asking a different question
No real number squares to a negative, so a trinomial with c < 0 cannot be a perfect square. That is not a near miss — it is a different category.
What it often is, when the middle term is absent, is a difference of squares. x² − 4 = (x + 2)(x − 2), which is the factorisation the question was really after. The tool gives it rather than only reporting that the perfect-square test failed.
With a middle term present and a negative constant, the trinomial may still factor — just not as a square, and not as a difference of squares either. The Factoring Trinomials Calculator handles that general case by the AC method.
Reading the identity backwards
The same identity used forwards squares a binomial and used backwards recognises one. Forwards is the Square of a Binomial Calculator; backwards is this page.
Recognition is the more valuable direction in practice, because it is what turns a three-term expression into a one-term one. (x + 3)² can be solved, shifted, differentiated and graphed in ways x² + 6x + 9 cannot without work.
Fractions are where the recognition gets harder by eye and the arithmetic stays easy. x² + x + (1/4) = (x + 1/2)² — a perfect square with a half in it, exact because the engine works over rationals rather than decimals.
Sources and methodology
The special-product identities are standard; the reference below carries their canonical statements.
Method. Every figure on this page comes from src/lib/perfect-square-trinomial.ts, which tests squareness by exact integer square roots over the rational coefficients rather than by comparing floating-point square roots. That is what lets 1/4 be recognised as (1/2)² and what makes the reported gap an exact fraction. That engine is verified on every change against 51 hand-written assertions, including that a trinomial reported as a perfect square expands back to itself, and that the reported required constant always produces one. The count and the per-case breakdown are published on the formula verification page.
Read the guide
The gap this page reports is the number completing the square adds and subtracts. Which Method Should You Use to Solve a Quadratic? covers when that method beats factoring and when the formula beats both.