Perfect Square Trinomial Calculator
Find out whether any trinomial is a perfect square with the b² = 4ac condition, read its factored form, and see the constant that completes the square.
Perfect Square Trinomial Calculator
A perfect square trinomial is a three-term polynomial that collapses into a single binomial multiplied by itself. The expression x squared plus six x plus nine is not three separate pieces of algebra at all — it is x plus three, squared. Recognizing that pattern lets you factor in one step, sketch a parabola in seconds, and see immediately that the graph touches the x-axis at exactly one point.
This calculator does three jobs, and it is worth stating clearly which jobs it does not do. It does not solve for roots. If you need the roots of a quadratic equation, the Quadratic Formula Calculator is the right tool. What this calculator does instead is classify and rewrite the expression you already have: it tests whether a x squared plus b x plus c is a perfect square trinomial, returns the factored form when the answer is yes, and computes the constant that completes the square when the answer is no. Along the way it reports the discriminant, the vertex form, and the coordinates of the vertex.
That division of labor matters because the two questions travel together but are not the same question. Solving asks "for which values of x does this expression equal zero?" Recognizing a perfect square asks "is this expression structurally a square of something?" A trinomial can be a perfect square without you ever wanting its roots — for instance when you are simplifying an algebraic fraction or checking whether a curve is tangent to an axis.
The classification test is short: a trinomial is a perfect square exactly when its discriminant equals zero, which is equivalent to the condition b squared equals four a c. That single equality is the whole idea, and it explains why the pattern shows up so often in textbook exercises — it is the boundary case between two distinct real roots and no real roots at all.
If your expression is not in standard form, convert it first with the Expanded Form Calculator. If you only need a numeric factorization without the perfect-square logic, the Factor Calculator covers the general case, and the Quadratic Equation Calculator handles the equation view.
Step 1: Put the expression in standard form. Write the polynomial as a x squared plus b x plus c, with the x squared term first and the constant last. If your expression is written as something like nine plus six x plus x squared, reorder it so a, b, and c are unambiguous. Signs belong to the coefficients: in three x squared minus ten x plus four, the value of b is negative ten, not ten.
Step 2: Enter the three coefficients. Type a, b, and c into the inputs. The coefficient a is the number multiplying x squared, b is the number multiplying x, and c is the standalone constant. Decimals and negative numbers are accepted. The coefficient a must not be zero, since a zero would make the expression linear rather than quadratic — a case where the whole perfect-square vocabulary stops applying.
Step 3: Read the classification. The calculator returns Perfect Square Trinomial as a Yes or No answer, together with the Discriminant, which is b squared minus four a c. A discriminant of exactly zero is the signature of a perfect square. Any other value means the trinomial is not a perfect square, no matter how tidy it looks.
Step 4: Take the factored form or the missing constant. When the answer is Yes, the calculator gives the Factored Form, a binomial squared. When the answer is No, that field is withheld and the calculator instead gives the Constant That Completes the Square, which is the value of c you would need for the discriminant to become zero while keeping a and b unchanged.
Step 5: Use the vertex output. In all cases you get the Vertex Form and the Vertex as a coordinate pair. These come from the same completing-the-square maneuver and are the fastest way to describe the shape and position of the parabola.
Worked Example 1: x squared plus six x plus nine
Take a equals 1, b equals 6, and c equals 9. The discriminant is 6 squared minus 4 times 1 times 9, which is 36 minus 36, equal to 0.
The calculator reports Perfect Square Trinomial: Yes, Discriminant: 0, and Factored Form: (1x + 3) squared. The Constant That Completes the Square is 9 — the constant is already the right one. The Vertex Form is 1(x + 3) squared plus 0 and the Vertex is (-3, 0). Notice that the constant inside the binomial, 3, is half of b, and the constant term 9 is that half squared. That is the pattern in miniature.
Worked Example 2: four x squared plus twelve x plus nine
Now take a equals 4, b equals 12, and c equals 9. The discriminant is 144 minus 144, equal to 0, so the answer is Yes again, but the binomial is not simply x plus something.
The calculator reports Factored Form: (2x + 3) squared, Constant That Completes the Square: 9, and Vertex: (-1.5, 0). Here the square root of a is 2 and the square root of c is 3, and the middle coefficient 12 is exactly twice their product — 2 times 2 times 3. When a is not 1, the lead coefficient has to be a perfect square itself for the trinomial to qualify, which is why x squared plus five x plus nine fails the test while four x squared plus twelve x plus nine passes it.
Worked Example 3: x squared plus five x plus nine
Finally, take a equals 1, b equals 5, and c equals 9. The discriminant is 25 minus 36, equal to negative 11.
The calculator reports Perfect Square Trinomial: No, Discriminant: -11, and Constant That Completes the Square: 6.25, with no factored form. The Vertex Form is 1(x + 2.5) squared plus 2.75 and the Vertex is (-2.5, 2.75). The vertex sits above the x-axis, which is consistent with a negative discriminant: the parabola never crosses the axis, so there is nothing to factor into real linear pieces.
Where the condition b squared equals four a c comes from. Expand a general binomial square and see what it forces:
Matching coefficients against a x squared plus b x plus c gives a equals p squared, b equals 2 p q, and c equals q squared. [mathworld-perfect-square-trinomial]
Now square b and substitute the other two relations:
That is the entire condition. A trinomial factors as a perfect square if and only if the square of the middle coefficient equals four times the product of the outer coefficients. Rearranged, it says the middle term must be twice the product of the two square roots:
This is why every perfect square trinomial has the same silhouette: a lead coefficient that is a perfect square, a constant that is a perfect square, and a middle term that is exactly twice the product of their roots, with a sign that matches the sign of b. Positive b gives a sum, negative b gives a difference. [purplemath-special-products] The recognition step is the part students practice most: once the silhouette is familiar, spotting a candidate takes a glance and verifying it takes one multiplication. [khan-perfect-square-trinomials]
The discriminant in this picture. The discriminant of a quadratic expression is
and the perfect-square condition is simply D equals 0. [mathworld-discriminant] That is not a coincidence; the discriminant measures how far the middle term is from balancing the outer terms. When D is positive, the parabola crosses the x-axis at two distinct points and the expression factors into two different linear factors. When D is negative, there are no real linear factors at all, and the trinomial is irreducible over the reals. When D is exactly zero, the two factors coincide and the expression is a single binomial squared. [openstax-quadratic-equations]
The missing constant. If a and b are fixed and c is wrong, the value that would make the trinomial a perfect square is obtained by solving b squared equals four a c for c:
This is the number the calculator reports as the Constant That Completes the Square. Adding it to x squared plus b x produces a square, which is exactly the maneuver used to finish the square. [openstax-completing-square]
Completing the square and vertex form. Completing the square rewrites the expression so that x appears only once, inside a square. Define h as minus b over two a and k as the height at that x:
The expression becomes
with the point (h, k) as the vertex of the parabola. [mathsisfun-completing-square] When the trinomial is a perfect square, D equals 0 forces k to equal 0, so the vertex form collapses to a(x minus h) squared and the vertex lands exactly on the x-axis. A perfect square trinomial is therefore the algebraic fingerprint of a parabola tangent to the x-axis.
The maneuver itself is old and mechanical: move the constant aside, add and subtract the square of half the linear coefficient, and regroup. [wikipedia-completing-the-square] Written out on the general trinomial, that same regrouping is what produces the quadratic formula — which is why the two tools agree on the discriminant even though they answer different questions.
Manual step-through for four x squared plus twelve x plus nine. Factor 4 out of the first two terms; that gives 4 times (x squared plus 3x) plus 9. Half of 3 is 1.5, and 1.5 squared is 2.25, so add and subtract 4 times 2.25, which is 9. The expression becomes 4 times (x plus 1.5) squared, minus 9 plus 9, which is 4(x + 1.5) squared plus 0. The vertex is at (-1.5, 0), matching the calculator output exactly.
| x² + 6x + 9 | (1, 6, 9) | 0 | Yes | (x + 3)² |
| 4x² + 12x + 9 | (4, 12, 9) | 0 | Yes | (2x + 3)² |
| 9x² − 24x + 16 | (9, −24, 16) | 0 | Yes | (3x − 4)² |
| x² − 10x + 25 | (1, −10, 25) | 0 | Yes | (x − 5)² |
| x² + 5x + 9 | (1, 5, 9) | −11 | No | 6.25 |
| x² + 8x + 10 | (1, 8, 10) | 24 | No | 16 |
| 4x² + 20x + 16 | (4, 20, 16) | 144 | No | 25 |
| 2x² + 6x + 9 | (2, 6, 9) | −36 | No | 4.5 |
The table tells a compact story. The first four rows are perfect squares, and every one of them has a discriminant of exactly zero. Their factorizations all share the shape of a binomial squared, and in each case the constant term is the square of half of b modulo a — 3 and 9, 3 and 9 again after factoring 4, 4 and 16, and 5 and 25. The last four rows are not perfect squares, and their discriminants are non-zero for two different reasons. A negative discriminant, as in x squared plus five x plus nine and in two x squared plus six x plus nine, means the outer terms are too large for the middle term to balance, so no real factorization into linear factors exists. A positive discriminant, as in x squared plus eight x plus ten and in four x squared plus twenty x plus sixteen, means the outer terms are too small, and the trinomial does factor — just not into two identical factors.
The final column is the practical payoff for the non-square rows. If you are completing the square by hand, you do not need to recompute the constant from scratch: for x squared plus eight x plus ten, the constant that would make it a perfect square is sixteen, so you borrow ten and leave six outside the square. That single number, b squared over four a, drives both the vertex form and the imaginary "what if c were right" version of the expression.
Check the outside coefficients first, before doing any arithmetic. If a is not a perfect square, or c is negative, the trinomial cannot be a perfect square trinomial. Testing 3x squared plus 12x plus 12 is wasted effort on a whole different level: a is 3, so p would be the square root of 3, which is not a rational number. A quick glance at a and c rules out most impostors before you touch the discriminant.
Remember that c must be non-negative for the perfect-square case. Since c equals q squared in the expansion, a negative constant immediately disqualifies the trinomial, even when the discriminant works out to zero. This is a frequent source of confusion when someone computes D equals 0 for a case where a is negative.
Use the half-of-b shortcut as a cross-check. For a monic trinomial, the constant must equal the square of half of b. For x squared plus six x plus nine, half of 6 is 3 and 3 squared is 9. For x squared plus five x plus nine, half of 5 is 2.5 and 2.5 squared is 6.25 — which is exactly the missing constant the calculator reports, and which is larger than the 9 you started with. Comparing c to that square tells you the sign of the discriminant without computing it.
Watch the sign of b. A perfect square trinomial with negative b factors as a difference, never as a sum. Nine x squared minus twenty-four x plus sixteen is (3x − 4) squared, and the minus sign is mandatory. Writing (3x + 4) squared would give twenty-four positive x, not negative twenty-four.
Do not confuse the missing constant with the actual constant. The Constant That Completes the Square is a hypothetical value — what c would need to be. For x squared plus five x plus nine, that value is 6.25, but the expression you have contains 9. Reporting 6.25 as if it were part of the original trinomial is the single most common misreading of the output.
Reach for the vertex output when graphing. The vertex form and vertex pair turn a graphing exercise into two coordinates. The sign inside the parentheses is inverted relative to the vertex x-coordinate: 1(x + 2.5) squared plus 2.75 describes a vertex at x equals negative 2.5, not positive 2.5.
Keep the tools separate in your head. When you need the actual roots, switch to the Quadratic Formula Calculator. When you need to know whether the expression is a square, or what constant would make it one, stay here.
It classifies and rewrites; it does not solve. This calculator returns no roots. The discriminant tells you how many real roots exist, but the values of x are the domain of the quadratic formula. If your problem asks "at what x does this equal zero?", factoring output alone will not answer it — although a perfect square trinomial does hand you the repeated root for free, since the root is minus h.
Perfect square means rational here. The condition b squared equals four a c guarantees a factorization over the rational numbers only when the square roots of a and c are themselves rational. A trinomial such as 2x squared plus four x plus 2 passes the discriminant test with D equals 0, but its factorization, if you insist on integer coefficients, requires pulling out a common factor first. The calculator reports the classification faithfully; the tidiness of the resulting binomial is a separate question.
Floating point values near zero. Coefficients entered as decimals can produce a discriminant of, say, 0.0000001 rather than exactly 0. The implementation compares against a small tolerance, which means two subtly different cases — a true perfect square and a trinomial that is merely extremely close to one — may be reported identically. For exact integer coefficients this is a non-issue.
The coefficient a must be non-zero. Setting a to zero turns the expression into a linear one, where the discriminant, the vertex, and the completing-the-square procedure are all meaningless. The calculator rejects that input rather than returning a misleading answer.
Verbose completions stay unfactored. When the missing constant is irrational, such as b squared over four a not simplifying to a rational, completion still works but the resulting form is rarely what a teacher means by "factor". The tool answers the structural question and leaves the aesthetic judgment to you.
Interpretation is not built in. The calculator does not know whether you are simplifying a rational expression, sketching a parabola, or checking a friend's work. A discriminant of zero means different things in those three settings, and the tool reports the number without deciding what it implies for your task.
- ❓ What makes a trinomial a perfect square?
- ✅ A trinomial a x^2 + b x + c is a perfect square when b^2 = 4ac, which means its discriminant is exactly zero. In that case it can be written as a single binomial squared, such as (x + 3)^2.
- ❓ Does this calculator solve for the roots?
- ✅ No. This tool classifies the trinomial, factors it when it is a perfect square, and completes the square to reach vertex form. For the actual roots, use the Quadratic Formula Calculator.
- ❓ Why does a perfect square always have discriminant zero?
- ✅ Expanding (px + q)^2 gives b = 2pq, and substituting into b^2 - 4ac yields exactly zero. The middle term always balances the outer terms when the expression is literally a square.
- ❓ What is the constant that completes the square?
- ✅ It is b^2 divided by 4a. Adding that value in place of the current constant makes the trinomial a perfect square while keeping a and b unchanged. For x^2 + 5x + 9, it is 6.25.
- ❓ My trinomial is not a perfect square. Is it useless?
- ✅ Not at all. A positive discriminant means it factors into two different linear factors, and a negative discriminant means it has no real factors. Either way you still get the vertex form and vertex from this calculator.
- ❓ Can the constant term be negative?
- ✅ If c is negative the trinomial can never be a perfect square, because c would have to equal q squared, which is never negative. The calculator will report No immediately.
- ❓ Does the coefficient a need to be a perfect square?
- ✅ Yes. Since a equals p squared in the expansion, a must be a perfect square for the factorization to have integer coefficients. So 4x^2 + 12x + 9 qualifies with (2x + 3)^2, but 2x^2 + 4x + 2 does not.
- ❓ How do I get the vertex from this calculator?
- ✅ The Vertex field gives the pair (h, k) with h = -b / 2a and k = c - b^2 / 4a. For a = 1, b = 5, c = 9 the vertex is (-2.5, 2.75) and the vertex form is 1(x + 2.5)^2 + 2.75.
- ❓ What if the answer is Yes — what changes in the vertex form?
- ✅ The k value becomes zero, so the vertex sits exactly on the x-axis and the vertex form collapses to a(x - h)^2. For 4x^2 + 12x + 9 you get 4(x + 1.5)^2 + 0 with vertex (-1.5, 0).
- ❓ Can I enter decimals instead of fractions?
- ✅ Yes, decimals are accepted for all three coefficients. Keep in mind that decimal inputs can produce a discriminant very close to but not exactly zero, and the calculator uses a small tolerance when testing the perfect-square condition.
- ❓ Why is there no Factored Form when the answer is No?
- ✅ Because the trinomial does not factor into two identical binomials. The Factored Form field is reserved for genuine perfect squares, and the Constant That Completes the Square field appears instead to show what would have been needed.
- ❓ Is the repeated root the same as the vertex x-coordinate?
- ✅ For a perfect square trinomial, yes. The single repeated root is x = -b / 2a, which is exactly h, the x-coordinate of the vertex. That is why the parabola touches the x-axis at the vertex.
References
- [1]Khan Academy. (n.d.). *Factoring perfect square trinomials* [Video]. Retrieved from https://www.khanacademy.org/math/algebra/x2f8bb11595b61c86:quadratics-multiplying-factoring/x2f8bb11595b61c86:special-products/v/factoring-perfect-square-trinomials.
- [2]Weisstein, E. W. (n.d.). *Perfect Square Trinomial*. Wolfram MathWorld. https://mathworld.wolfram.com/PerfectSquareTrinomial.html
- [3]Weisstein, E. W. (n.d.). *Discriminant*. Wolfram MathWorld. https://mathworld.wolfram.com/Discriminant.html
- [4]Stapel, E. (n.d.). *Perfect-Square Trinomials*. Purplemath. Retrieved from https://www.purplemath.com/modules/specfact3.htm.
- [5]OpenStax. (2020). *Solve Quadratic Equations by Completing the Square*. In Elementary Algebra 2e. https://openstax.org/books/elementary-algebra-2e/pages/10-2-solve-quadratic-equations-by-completing-the-square
- [6]OpenStax. (2021). *Quadratic Equations*. In College Algebra 2e. https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations
- [7]Pierce, R. (n.d.). *Completing the Square*. Math is Fun. Retrieved from https://www.mathsisfun.com/algebra/completing-square.html.
- [8]Wikipedia contributors. (2026). *Completing the square*. Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/Completing_the_square
Last updated: October 19, 2026
UnByte — Independent Software Engineering
Every calculator references authoritative sources — Editorial policy
