Precalculus

Binomial Expansion

The binomial theorem expands (ax + b)ⁿ into a sum of terms, each with a binomial coefficient C(n, k). This calculator computes every term, multiplies out the powers and collects the result into a polynomial in x.

Binomial Expansion

Expand (ax + b)ⁿ with the binomial theorem.

Try:
Answerx⁴ + 8x³ + 24x² + 32x + 16
  1. Binomial(1x + 2)⁴
  2. Term k = 0C(4,0)·(1x)⁴·(2)⁰ = 1x⁴
  3. Term k = 1C(4,1)·(1x)³·(2)¹ = 8x³
  4. Term k = 2C(4,2)·(1x)²·(2)² = 24x²
  5. Term k = 3C(4,3)·(1x)¹·(2)³ = 32x
  6. Term k = 4C(4,4)·(1x)⁰·(2)⁴ = 16
  7. Expansionx⁴ + 8x³ + 24x² + 32x + 16

Expanding a binomial power term by term

Multiplying (x + 2) by itself four times is straightforward but tedious, and every one of the intermediate products is a chance to drop a term. The binomial theorem removes the multiplication entirely: it gives each coefficient of the expanded result directly, without ever forming the intermediate polynomials.

This calculator expands (ax + b)ⁿ for a whole-number exponent, showing every term with its binomial coefficient before collecting them into the finished polynomial.

The tool handles the specific shape (ax + b)ⁿ, where the first term carries the variable and the second is a constant. That covers the standard exercises and the cases that appear inside calculus problems, where an expanded form is needed before differentiating or integrating.

Seeing the terms listed individually matters more than the final line. Each is labelled by its index k, so you can pick out a single coefficient — the one on x³, say — without expanding the rest by hand.

How to use this calculator

  1. Enter a, the coefficient of x For (x + 2)⁴ this is 1; for (2x − 1)³ it is 2. The coefficient is raised to a power in every term, so a value other than one changes all of them, not just the leading term.
  2. Enter b, the constant With its sign attached. For (2x − 1)³ enter b = −1, and the alternating signs in the result follow automatically from the odd powers of that negative.
  3. Enter the exponent n A whole number from 0 to 30. The upper bound is a deliberate guard: beyond it the coefficients grow past the range where double-precision arithmetic stays exact.
  4. Read the term list, then the collected result Each line shows the coefficient, the power of a and the power of b for one value of k. The final line is the same terms written as a polynomial in descending order.

The formula, and where it comes from

(ax + b)ⁿ = Σ from k = 0 to n of C(n, k)·(ax)ⁿ⁻ᵏ·bᵏ

Expanding the product means choosing, from each of the n factors, either the ax term or the b term. A term with k copies of b and n − k copies of ax can be assembled in C(n, k) distinct ways, which is exactly why the binomial coefficient appears: it counts the identical products that get collected together.

The implementation loops k from 0 to n, computes C(n, k)·a^(n−k)·b^k for each, and accumulates the value against the power of x, which is n − k. The list therefore runs from the highest power of x down to the constant.

What each input means

a Coefficient of x — form field “Coefficient a (of x)”
Multiplies the variable inside the bracket. It is raised to the power n − k in each term, so it contributes most to the leading terms and not at all to the constant.
b Constant term — form field “Constant b”
The number inside the bracket, entered with its sign. A negative b makes the signs alternate, because bᵏ changes sign with every increment of k.
n Exponent — form field “Exponent n”
How many times the bracket is multiplied by itself. It must be a whole number between 0 and 30, and the expansion always has exactly n + 1 terms.
C(n, k) Binomial coefficient
The number of ways to choose k items from n, read from row n of Pascal's triangle. These are the numbers in front of each term before the powers of a and b are applied.

Worked examples

Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.

A simple fourth power

Expand (x + 2)⁴. With a = 1 the coefficients come purely from the binomial coefficients and the powers of 2, which makes the structure easy to see.

Inputs Coefficient a (of x) = 1, Constant b = 2, Exponent n = 4

  1. Binomial (1x + 2)⁴
  2. Term k = 0 C(4,0)·(1x)⁴·(2)⁰ = 1x⁴
  3. Term k = 1 C(4,1)·(1x)³·(2)¹ = 8x³
  4. Term k = 2 C(4,2)·(1x)²·(2)² = 24x²
  5. Term k = 3 C(4,3)·(1x)¹·(2)³ = 32x
  6. Term k = 4 C(4,4)·(1x)⁰·(2)⁴ = 16
  7. Expansion x⁴ + 8x³ + 24x² + 32x + 16

Result x⁴ + 8x³ + 24x² + 32x + 16

The five terms correspond to the row 1, 4, 6, 4, 1 of Pascal's triangle, each multiplied by a rising power of 2. Reading the k = 2 line alone gives the x² coefficient without expanding anything else — the main practical use of the theorem.

The powers of x descend from four to zero while the powers of b climb from zero to four. Those two exponents always sum to n, which is the quickest check that a term has been written correctly.

A negative constant and a coefficient on x

Expand (2x − 1)³. Here both a and b do real work: the coefficient is cubed at the leading term, and the negative constant alternates the signs.

Inputs Coefficient a (of x) = 2, Constant b = -1, Exponent n = 3

  1. Binomial (2x − 1)³
  2. Term k = 0 C(3,0)·(2x)³·(-1)⁰ = 8x³
  3. Term k = 1 C(3,1)·(2x)²·(-1)¹ = -12x²
  4. Term k = 2 C(3,2)·(2x)¹·(-1)² = 6x
  5. Term k = 3 C(3,3)·(2x)⁰·(-1)³ = -1
  6. Expansion 8x³ − 12x² + 6x − 1

Result 8x³ − 12x² + 6x − 1

The leading coefficient is 8 rather than 1, because a = 2 is raised to the third power. This is the detail most often lost when the theorem is applied from memory, where the coefficient on x is quietly treated as 1.

The signs alternate because (−1)ᵏ flips with each term. If your own expansion has all-positive signs, the negative was almost certainly left outside the bracket rather than entered as part of b.

Reading the result

Reading a single coefficient

The term labelled k gives the coefficient of x raised to n − k. To find the coefficient of x² in a fifth power, look for k = 3, not k = 2 — the index counts constants used, not the power of x.

Exactness of the coefficients

With whole-number inputs the coefficients are exact integers within the supported range. Decimal values for a or b are displayed to six significant figures, so an expansion with fractional coefficients will show rounded values.

The n = 0 and n = 1 cases

Both are handled rather than rejected. An exponent of zero gives the single term 1, and an exponent of one returns the bracket unchanged. They are useful as a check that the tool is behaving as expected.

When you would use this

Extracting one coefficient from a large power

Exam questions frequently ask for a single term of an expansion — the x⁵ coefficient of (3x − 2)⁸, for instance — precisely because expanding the whole thing by multiplication is impractical. The term list answers that directly.

Preparing an expression for calculus

Differentiating or integrating a bracketed power term by term requires the expanded polynomial first. For low exponents that is often quicker than applying the chain rule and simplifying afterwards.

Assumptions and limitations

What this calculator assumes

  • The binomial has the exact form (ax + b), with the variable in the first term and a constant in the second.
  • The exponent is a whole number between 0 and 30; the upper limit keeps the coefficients within exact double-precision arithmetic.
  • Terms are collected by power of x and reported in descending order.

Where it stops being the right tool

  • Negative and fractional exponents are rejected. Those produce infinite binomial series, which converge only for |ax| < |b| and are a different topic entirely.
  • Only two terms in the bracket. Trinomials such as (x + y + 1)ⁿ need the multinomial theorem.
  • One variable only: expansions such as (x + y)ⁿ with two symbolic terms are not supported, since b must be numeric.

Common mistakes

Forgetting to raise the coefficient of x to its power

Why it happens. Pascal's triangle is memorised as a row of plain numbers, so those numbers get written down as the coefficients directly — correct only when a = 1.

How to avoid it. Each term needs C(n, k) multiplied by a to the power n − k. Compare your leading term with the tool's: for (2x − 1)³ it should be 8x³, not x³.

Leaving a minus sign outside the bracket

Why it happens. Writing (2x − 1)³ as “the expansion of (2x + 1)³ with a minus somewhere” loses the alternation, because only the odd-power terms change sign.

How to avoid it. Enter b as a negative number. The signs then alternate automatically, and every second term differs from the all-positive version.

Confusing the index k with the power of x

Why it happens. Both run over the same range, and k is the more visible label on each line, so it gets read as the exponent.

How to avoid it. The power of x is n − k. Use the fact that the two exponents in a term always add to n to confirm which is which.

Key terms

Frequently asked questions

What does the binomial theorem state?

That (p + q)ⁿ equals the sum over k from 0 to n of C(n, k)·p^(n−k)·q^k. Here p is ax and q is b, so each term combines a binomial coefficient with a power of a and a power of b.

Where do the coefficients come from?

Each C(n, k) counts the number of ways to pick k of the n brackets to contribute their constant. Those counts form row n of Pascal's triangle, which is why the familiar 1, 4, 6, 4, 1 pattern appears for the fourth power.

Can the exponent be negative or fractional?

Not here. The solver requires a whole number from 0 to 30. Negative or fractional exponents produce an infinite series rather than a finite polynomial, and it converges only under a condition on the size of the terms.

Why is the exponent capped at 30?

Because the binomial coefficients grow very quickly. Beyond about this point the products exceed the range where double-precision arithmetic represents integers exactly, so the guard prevents silently inexact coefficients.