Perfect Square Trinomial Calculator - Discriminant and Factored Form

Use this perfect square trinomial calculator to test ax^2 + bx + c, see the discriminant, double root, and read the canonical or (px + q)^2 form.

Updated: June 16, 2026 • Free Tool

Perfect Square Trinomial Calculator

Leading coefficient of x^2 in the trinomial ax^2 + bx + c. Must be non-zero for a proper quadratic.

Middle coefficient of x in the trinomial. May be positive, negative, or zero.

Constant term of the trinomial. For a real perfect square trinomial (px + q)^2, both a and c must be non-negative because a = p^2 and c = q^2.

Results

Perfect square trinomial?
0
Discriminant (b^2 - 4ac) 0
Double root (x = -b / 2a) 0
Factored form: a(x - r)^2 0
Alternate form: (px + q)^2 0
p (square root of a) 0
q (b / 2p) 0

What Is a Perfect Square Trinomial Calculator?

A perfect square trinomial calculator takes the three coefficients a, b, c of ax^2 + bx + c and tells you in one step whether the trinomial is the square of a linear expression, returning the double root and factored form when the test is positive.

  • Homework and textbook checks: Verify whether ax^2 + bx + c matches the (px + q)^2 pattern without redoing the discriminant test on scratch paper.
  • Completing the square in reverse: Read the canonical a(x - r)^2 form of any quadratic whose constant is already a perfect square, so completing the square becomes a one-line verification.
  • Pre-check before solving ax^2 + bx + c = 0: Confirm the discriminant is zero before treating the equation as having a single repeated root, the case every quadratic formula student encounters once per chapter.
  • Symbolic simplification in algebra problems: Replace a trinomial with its squared-binomial form so the next step in a long problem starts from a simpler expression.

A perfect square trinomial is a quadratic that equals the square of a linear expression, so ax^2 + bx + c = (px + q)^2 with real p and q. The test is two-sided: b^2 - 4ac must equal zero and a must be non-negative so the squared binomial is real. When a is negative, the trinomial equals -(px + q)^2, the negation of a perfect square rather than a perfect square itself.

For an integer N = a^2 (a single number rather than a polynomial in x), Perfect Square Calculator tests the integer perfect-square property and shows the integer root.

How the Perfect Square Trinomial Calculator Works

The calculator reads the three coefficients a, b, c, computes the discriminant, and uses its value to decide between the perfect-square and the not-perfect-square branch.

D = b^2 - 4ac; ax^2 + bx + c is a real perfect square trinomial ⇔ D = 0 and a > 0
  • a: Coefficient of x^2. Square root of a is p in the (px + q)^2 form when a is positive.
  • b: Coefficient of x. Twice p*q in the (px + q)^2 form, so its sign matches the sign of q when p is positive.
  • c: Constant term. Equal to q^2 in the (px + q)^2 form, so c must be non-negative when a is positive. With a negative, no real (px + q)^2 exists and the verdict is No.
  • D = b^2 - 4ac: Discriminant of the quadratic. Zero means the trinomial is a perfect square with a single repeated root.

The canonical a(x - r)^2 form is real whenever the discriminant is zero, because r = -b / (2a) is a real number for any real a, b, c. The alternate (px + q)^2 form needs a positive a, with a fallback message when a is negative or not a perfect square.

When the discriminant is not zero, the panel returns verdict No and prints the discriminant value, so the user sees how far the trinomial is from the perfect-square case.

Test 4x^2 + 12x + 9

Inputs: a = 4, b = 12, c = 9. D = 144 - 144 = 0, so the trinomial is a perfect square. Double root r = -12 / 8 = -1.5. Canonical: 4(x + 1.5)^2. Alternate: (2x + 3)^2 with p = 2, q = 3.

Verdict: Yes. Discriminant: 0. Double root: -1.5. Canonical form: 4(x + 1.5)^2. Alternate form: (2x + 3)^2.

The discriminant is zero and b = 12 = 2 * 2 * 3, so the trinomial factors as (2x + 3)^2 with a = 2^2 and c = 3^2.

According to Omni Calculator, a trinomial ax^2 + bx + c is a perfect square trinomial when b^2 = 4ac, and the example 4x^2 + 12x + 9 equals (2x + 3)^2 with discriminant zero and double root x = -3/2.

After confirming the discriminant is zero, Quadratic Formula Calculator returns the single repeated root from the quadratic formula so the two values agree to the last decimal.

Key Concepts Behind Perfect Square Trinomials

Four ideas cover everything the result panel reports and explain why the canonical and alternate forms are equivalent when a is a perfect square.

The perfect square trinomial identity

Squaring a binomial gives (px + q)^2 = p^2 x^2 + 2pq x + q^2. The leading coefficient is p^2, the constant is q^2, and the middle coefficient is exactly 2pq.

The discriminant-zero condition

The discriminant D = b^2 - 4ac equals zero exactly when the trinomial has a single repeated real root. A non-zero discriminant means the trinomial factors as (x - r1)(x - r2) with two distinct roots, not a single squared bracket.

Canonical form a(x - r)^2

When D = 0, the trinomial rewrites as a * (x - r)^2 where r = -b / (2a). This form shows the squared shape directly for any real coefficients.

Alternate (px + q)^2 form

The matching binomial form is (px + q)^2 with p = sqrt(a) and q = b / (2p). Real only when a is positive; shows the binomial pair most clearly when a is a perfect square integer.

These four ideas are the entire rule set. The same identity is what textbooks use when they say a trinomial completes the square.

For trinomials that are not perfect squares, Factoring Trinomials Calculator runs the general ax^2 + bx + c factoring routine and returns the integer or rational factor pair when one exists.

How to Use This Perfect Square Trinomial Calculator

Type the three coefficients of ax^2 + bx + c, read the verdict, and use the canonical or alternate form as the next algebra step.

  1. 1 Enter coefficient a: Type the leading coefficient of x^2. Use 4 for 4x^2 and 1 for x^2. The field must be non-zero.
  2. 2 Enter coefficient b: Type the middle coefficient of x. Use -12 for a negative middle term.
  3. 3 Enter the constant term c: Type the constant c. For a real (px + q)^2 result, c must be non-negative because c = q^2. With a negative and D = 0, the trinomial is the negation of a perfect square.
  4. 4 Read the verdict: Yes means b^2 = 4ac with a positive, so the trinomial equals (px + q)^2. No means the discriminant is not zero or a is negative.
  5. 5 Read the discriminant and double root: The Discriminant row should be 0 for a perfect square. The Double root row gives x = -b / (2a).
  6. 6 Use the factored form: Copy the canonical a(x - r)^2 form, or the (px + q)^2 form when a is a perfect square.

Example: a student is asked to factor 4x^2 + 12x + 9. They type 4, 12, 9. Verdict reads Yes, discriminant 0, double root -1.5, canonical form 4(x + 1.5)^2, alternate (2x + 3)^2.

When the squared form needs to be combined with another polynomial, Add Subtract Polynomials Calculator adds or subtracts the two expressions in standard form so the result is ready for the next line of the problem.

Benefits of Using This Perfect Square Trinomial Calculator

Five practical advantages make the calculator more useful than running the discriminant test by hand.

  • One-step Yes/No verdict: Type three coefficients and read the perfect-square verdict at a glance, instead of computing b^2 - 4ac on paper.
  • Discriminant and double root together: The panel reports the discriminant and the double root next to the verdict, so the user sees why the test passed or failed and where the parabola touches the axis.
  • Two factored forms side by side: The canonical a(x - r)^2 form is shown for a perfect square trinomial, and the alternate (px + q)^2 form is added when a is a perfect square.
  • Works with decimals and fractions: Inputs such as 0.25, -1, and 1 for 0.25x^2 - x + 1 are read as exact coefficients, and result strings are formatted to four decimal places.
  • Negative or non-perfect-square a is handled: With a negative, the verdict flips to No with a note that the trinomial is the negation of a perfect square. With a positive but not a perfect square integer, the canonical form is still real and the alternate row returns a clean fallback message.

The biggest benefit is that the next step in the problem is visible immediately. The canonical form goes into factoring, the double root goes into the quadratic formula.

When the perfect square form needs to be divided by the original trinomial, Polynomial Division Calculator runs long division with the same coefficient list and returns the quotient and remainder.

Factors That Affect the Verdict and Its Limits

The discriminant decides everything, and three coefficient features change which factored form the panel can show in a clean way.

Sign of the middle coefficient b

When b is positive, the form is (x + |q|)^2 and q is non-negative. When b is negative, the form is (x - |q|)^2 and q is negative, so the panel flips the sign.

Sign and value of the leading coefficient a

a > 0 with a perfect square gives the cleanest (px + q)^2 form. a > 0 with a not-perfect-square a keeps the canonical form real and the alternate as a fallback. a < 0 flips the verdict to No because the trinomial is the negation of a perfect square, not a perfect square itself.

Magnitude of the discriminant b^2 - 4ac

The discriminant is exactly zero for a perfect square trinomial. As soon as b^2 - 4ac moves away from zero, the verdict flips to No and the panel shows the gap.

  • The calculator accepts ax^2 + bx + c in one variable, x. Trinomials in two variables such as x^2 + xy + y^2 or higher-degree expressions are not supported.
  • A trinomial with a = 0 collapses to a linear expression and the perfect-square test does not apply. The panel shows a clear "a must be non-zero" message in that case.

For most algebra work the limitations are a non-issue, because the common textbook case is a single-variable quadratic with three non-zero terms.

According to Wolfram MathWorld, ax^2 + bx + c = 0 has a repeated real root exactly when b^2 - 4ac equals zero, the same condition for ax^2 + bx + c to be a perfect square trinomial.

According to Paul's Online Math Notes, completing the square on ax^2 + bx + c gives a(x + b/(2a))^2 + (4ac - b^2) / (4a), and the constant term disappears when b^2 = 4ac.

When the perfect square trinomial is also worth plotting, Polynomial Graphing Calculator draws the parabola from the same a, b, c list and shows the vertex touching the x-axis at the double root.

Perfect square trinomial calculator interface showing the verdict, discriminant, double root, and the canonical or (px + q)^2 factored form.
Perfect square trinomial calculator interface showing the verdict, discriminant, double root, and the canonical or (px + q)^2 factored form.

Frequently Asked Questions

Q: What is a perfect square trinomial?

A: A perfect square trinomial is a quadratic ax^2 + bx + c that equals the square of a linear expression: ax^2 + bx + c = (px + q)^2 = p^2 x^2 + 2pq x + q^2. The leading coefficient is p^2, the constant is q^2, and the middle term is exactly 2pq.

Q: How do you tell if a trinomial is a perfect square?

A: Compute the discriminant D = b^2 - 4ac. The trinomial is a real perfect square (px + q)^2 if and only if D = 0 and a is positive, so the squared binomial is real. When D = 0 with a negative, the trinomial equals -(px + q)^2, the negation of a perfect square, and the calculator returns verdict No. The calculator returns Yes or No in one step.

Q: What is the formula for a perfect square trinomial?

A: A perfect square trinomial has the form a^2 x^2 + 2ab x + b^2 = (ax + b)^2. For a general quadratic ax^2 + bx + c, the matching formula is p = sqrt(a) and q = b / (2p), giving the canonical a(x + q/p)^2 form and the alternate (px + q)^2 form when a is a non-negative perfect square.

Q: What is the discriminant of a perfect square trinomial?

A: The discriminant b^2 - 4ac of a perfect square trinomial is exactly zero. A non-zero discriminant means the quadratic has two distinct real roots (or a pair of complex conjugates), so the trinomial factors as (x - r1)(x - r2).

Q: Can a perfect square trinomial have a negative middle term?

A: Yes. 9x^2 - 30x + 25 is a perfect square trinomial that factors as (3x - 5)^2. The sign of the middle coefficient b is twice p*q, so b is negative exactly when p and q have opposite signs in the (px + q)^2 form.

Q: How do you factor a perfect square trinomial?

A: Take the square root of a to get p, divide b by 2p to get q, and write the factored form (px + q)^2. The calculator does this in one step, returns the canonical a(x - r)^2 form using the double root r = -b / (2a), and adds the (px + q)^2 form when a is a non-negative perfect square.