Square of a Binomial Calculator
Expand (ax + b)² into a²x² + 2abx + b²: enter a and b to get the x² coefficient, the middle x coefficient and the constant term of the trinomial.
Square of a Binomial Calculator
Background.
The most common slip in school algebra is writing (x + 3)² as x² + 9. It looks right, it is wrong, and it is wrong for a reason worth seeing. Squaring a sum means multiplying it by itself, (x + 3)(x + 3), and that produces four products, not two: x², 9, and two copies of 3x. The correct answer is x² + 6x + 9, and the missing 6x is the whole story.
A picture makes it stick. Draw a square with side x + 3 and divide each side into a piece of length x and a piece of length 3. Inside you get an x-by-x square, a 3-by-3 square, and two x-by-3 rectangles. Those two rectangles are the middle term, which is why it carries a factor of 2.
In general, (ax + b)² = a²x² + 2abx + b². The first and last coefficients are squares, so they can never be negative. The middle one takes the sign of a × b, which is why (3x − 2)² has a minus sign in the middle and nowhere else.
The same identity runs in reverse, and that is where it earns its keep. Spotting that 9x² − 12x + 4 is a perfect square lets you factor it in one step, and completing the square, the technique behind the quadratic formula, is this identity applied backwards. It even helps with mental arithmetic: 103² is (100 + 3)², or 10,000 + 600 + 9 = 10,609.
Here you enter the numbers a and b and get back the three coefficients of the expanded trinomial. Both may be negative, zero or decimal; only numeric coefficients are handled, not letters.
What is square of a binomial calculator?
The square of a binomial is the result of multiplying a two-term expression by itself. For a binomial of the form ax + b, the identity (ax + b)² = a²x² + 2abx + b² gives the expansion directly: the square of the first term, twice the product of the two terms, and the square of the second term. The three-term result is called a perfect square trinomial.
How to use this calculator.
- Write your binomial in the form ax + b and read off the two numbers. For (x + 5)², a is 1 and b is 5; for (2x − 7)², a is 2 and b is −7.
- If the constant comes first, as in (5 − x)², take a = −1 and b = 5. The expansion is the same as for (x − 5)², because a squared expression does not care about an overall sign.
- Enter fractions as decimals, for example 0.5 for x/2.
- Read the x² coefficient, the x coefficient and the constant term, and assemble them as a²x² + 2abx + b².
The formula.
(ax + b)² = a²x² + 2abx + b². The x² coefficient is a², the square of the number in front of x. The constant term is b², the square of the number on its own. The x coefficient is 2ab: when (ax + b)(ax + b) is multiplied out, the cross products ax × b and b × ax are equal, and together they give 2abx. Because a² and b² are squares, those two coefficients are never negative; the middle coefficient is negative exactly when a and b have opposite signs, and zero if either is zero. Every perfect square trinomial has discriminant (2ab)² − 4a²b² = 0, so its graph touches the x-axis at a single point, x = −b/a.
A worked example.
Expand (3x − 2)², so a = 3 and b = −2. The x² coefficient is a² = 3² = 9. The x coefficient is 2ab = 2 × 3 × (−2) = −12. The constant term is b² = (−2)² = 4. The expansion is 9x² − 12x + 4. A quick check by substitution: at x = 2, the original gives (6 − 2)² = 16 and the expansion gives 36 − 24 + 4 = 16. The discriminant of the result is (−12)² − 4 × 9 × 4 = 144 − 144 = 0, confirming a perfect square with a repeated root at x = 2/3, where 3x − 2 is zero.
Frequently asked questions.
Why isn't (x + 3)² equal to x² + 9?
How do I spot a perfect square trinomial so I can factor it?
What does squaring a binomial have to do with completing the square?
Can I expand something like (2x + 3y)² here?
How can I square numbers like 97 in my head?
References& sources.
- [1]OpenStax, Intermediate Algebra 2e, Special Products.
- [2]OpenStax, College Algebra 2e, Polynomials.
- [3]BIPM, The International System of Units (SI Brochure), 9th ed., version 3.01, coherent derived units and quantity equations.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 3 cited below
- Method
- (ax+b)^2 = a^2 x^2 + 2ab x + b^2
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled