This square trinomial calculator does two things. It expands a squared binomial (ax + b)² into a trinomial, and it checks whether ax² + bx + c is a perfect-square trinomial and, if it is, tells you what to factor it into.
Square Trinomial Calculator
Expand (ax + b)² into a perfect-square trinomial, or check whether ax² + bx + c is already a perfect square and factor it.
Starting values: the expand mode opens with a = 2 and b = 3, so (2x + 3)² becomes 4x² + 12x + 9. The check mode opens with a = 4, b = 12 and c = 9, and reports that it is a perfect square.
Expanding (ax + b)²
Squaring a binomial always gives a trinomial with the same pattern:
(ax + b)² = a²x² + 2ab x + b²
Where:
- a² = the x² coefficient
- 2ab = the x coefficient
- b² = the constant term
The expand mode returns exactly these three numbers. For the default, a = 2 and b = 3: a² = 4, 2ab = 12 and b² = 9, so the result is 4x² + 12x + 9. A textbook states the same pattern: (a + b)² = a² + 2ab + b², and (a − b)² = a² − 2ab + b². To expand a difference such as (2x − 3)², enter b as −3: the middle term becomes −12.
Checking for a perfect-square trinomial
A trinomial ax² + bx + c is a perfect square exactly when:
b² = 4ac
In words, the first and last terms must be squares, and the middle term must be twice the product of their square roots. The check mode reports yes or no for this condition and also shows √a and √c. When the answer is yes, the trinomial factors as:
(√a · x + √c)² if b is positive
(√a · x − √c)² if b is negative
The calculator gives you √a and √c, not a finished factored expression, so you write the factorization yourself from those two numbers and the sign of b.
Worked examples
Example 1: the default check, a = 4, b = 12, c = 9
- b² = 144, and 4ac = 4 × 4 × 9 = 144. They match, so it is a perfect square.
- √a = 2 and √c = 3.
- b is positive, so the factorization is (2x + 3)².
This is the reverse of the default expansion, which is a good way to see that the two modes are inverses of each other.
Example 2: a negative middle term
An open algebra text gives 81y² − 72y + 16. Here a = 81, b = −72 and c = 16. Then b² = 5,184 and 4ac = 4 × 81 × 16 = 5,184, so it is a perfect square. √a = 9 and √c = 4, and because b is negative, the factorization is (9y − 4)².
Example 3: another perfect square
9x² + 12x + 4. Check: b² = 144 and 4ac = 4 × 9 × 4 = 144. √a = 3, √c = 2, so it factors as (3x + 2)². The same text lists this one among its examples.
Example 4: a near miss
The same source warns about 9x² + 50x + 25. The first and last terms are squares (3x)² and 5², but twice their product is 2 × 3x × 5 = 30x, not 50x. Check: b² = 2,500 and 4ac = 4 × 9 × 25 = 900. They do not match, so it is not a perfect square. It can still be factored another way, as (9x + 5)(x + 5), but not as a square.
Why this pattern is worth knowing
Spotting a perfect-square trinomial turns a factoring problem into a one-step answer. It also shows up when you complete the square to solve a quadratic equation or find a parabola’s vertex. If an equation has a perfect square on one side, the solution is a square root away. For equations that are not perfect squares, the quadratic formula calculator handles the general case.
Common mistakes
- Forgetting the middle term when squaring. (x + 3)² is not x² + 9. It is x² + 6x + 9.
- Ignoring the sign of b when you factor. A negative middle term gives a minus inside the bracket.
- Assuming that square first and last terms always make a perfect square. Check the middle term.
- Entering a negative c in the check mode. The tool only allows c of zero or more, since a perfect square has a non-negative last term.
Using the pattern to expand any binomial square
Here is a short routine for expanding by hand, which you can check against the expand mode. Square the first term, double the product of the two terms, and square the last term. For (3x + 5)², that gives 9x² + 30x + 25. For (x − 4)², enter a = 1 and b = −4: you get x² − 8x + 16. For (5x − 2)², the result is 25x² − 20x + 4.
Notice that the constant term is always positive, since it is b squared, and that only the middle term carries the sign of b. If you see a trinomial with a negative last term, such as x² + 4x − 5, it cannot be a perfect square, because a perfect square cannot end in a negative number.
Working backwards from a trinomial
To factor a suspected perfect square by hand, take the square roots of the first and last terms, then confirm that twice their product equals the middle term in size. Use the check mode to confirm this in one step. For 25x² + 30x + 9, the tool shows √a = 5 and √c = 3. Twice 5 times 3 is 30, which matches b, so the factored form is (5x + 3)².
When the numbers are not perfect squares
The condition b² = 4ac does not require a and c to be whole-number squares. For 2x² + 4x + 2, a = 2, b = 4 and c = 2 satisfy b² = 16 = 4ac, so it is a perfect square in the sense that it equals 2(x + 1)². In that case the check mode shows √a and √c as decimals (1.4142 each). The factorization (√a · x + √c)² is still correct, but it is neater to take out the common factor of 2 first.
Frequently asked questions
How do I know if a trinomial is a perfect square?
Check whether b² equals 4ac. If it does, the first and last terms are squares and the middle term is twice the product of their roots, so it factors as a squared binomial.
Does the calculator give the factored form directly?
It reports whether the trinomial is a perfect square and shows √a and √c. You then write (√a x + √c)² if b is positive, or (√a x − √c)² if b is negative.
How do I expand (2x − 3) squared?
Use the expand mode with a = 2 and b = −3. The coefficients are 4, −12 and 9, giving 4x² − 12x + 9.
Is x squared plus 9 a perfect square trinomial?
No. It has no middle term, so b = 0 while 4ac = 36. Squaring (x + 3) gives x² + 6x + 9, which needs the 6x term.
