Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Binomial expansion calculator

Expand (a·x + b)ⁿ exactly, with every term, the general term and Pascal's triangle.

(a·x + b)ⁿ

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Need C(n, k) on its own, or for big n? Use the permutation and combination calculator.

What it does

This calculator expands (a·x + b)ⁿ for any whole numbers a and b and any power n from 0 to 30. It lists every term with its exact coefficient, the matching row of Pascal's triangle, and any single term you ask for. Big coefficients are worked out with exact whole-number arithmetic, so even (2x + 3)³⁰ comes out to the last digit.

How it's calculated: the binomial theorem

(a·x + b)ⁿ = Σ C(n, k) · (a·x)ⁿ⁻ᵏ · bᵏ,   for k = 0, 1, …, n    with C(n, k) = n! ÷ (k! (n − k)!)

There are n + 1 terms. Term number k + 1 is C(n, k) · aⁿ⁻ᵏ · bᵏ · xⁿ⁻ᵏ. The numbers C(n, k) are the binomial coefficients. They form row n of Pascal's triangle, where each number is the sum of the two above it: C(n, k) = C(n − 1, k − 1) + C(n − 1, k).

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1

Worked example

Expand (2x + 3)³. Row 3 of Pascal's triangle is 1, 3, 3, 1.

1·(2x)³ + 3·(2x)²·3 + 3·(2x)·3² + 1·3³ = 8x³ + 36x² + 54x + 27

Check: put x = 1. The left side is 5³ = 125, and the right side is 8 + 36 + 54 + 27 = 125. In general the coefficients add up to (a + b)ⁿ.

Where binomial expansions show up

The same coefficients count outcomes in probability. Expanding (p + q)ⁿ, with p the chance of success and q = 1 − p, gives each term as the probability of exactly k successes in n tries: the binomial distribution. They also appear in compound growth, polynomial approximations such as (1 + x)ⁿ ≈ 1 + nx for small x, and in counting paths on a grid.

Finding one term

To find the 3rd term of (x − 2)⁶, use k = 2: C(6, 2) · 1⁴ · (−2)² · x⁴ = 15 · 4 · x⁴ = 60x⁴. The signs alternate when b is negative, because (−2)ᵏ is negative for odd k.

Limitations

  • a and b must be whole numbers from −1,000,000 to 1,000,000, and n a whole number from 0 to 30. For fractional or negative powers the series never ends, so it isn't covered here.
  • Terms are written from the highest power of x down. Some textbooks write (b + a·x)ⁿ starting from the constant, which reverses the term numbers.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • (2x + 3)³ = 8x³ + 36x² + 54x + 27 ✓
  • (x − 1)⁵ alternates signs ✓
  • (x + 1)³⁰, term 16: C(30, 15) = 155,117,520 ✓
  • (2x + 3)³⁰: the coefficients add up to 5³⁰ exactly ✓
  • 3rd term of (x − 2)⁶ = 15 × 4 x⁴ = 60x⁴ ✓
  • Edge: (2x + 3)⁰ = 1 ✓
  • Edge: n = 31 is over the limit ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

What is the binomial theorem?

It says (a + b)ⁿ = Σ C(n, k) aⁿ⁻ᵏ bᵏ for k from 0 to n. It expands any power of a sum without multiplying the brackets out by hand.

How is Pascal's triangle related to binomial expansion?

Row n of Pascal's triangle gives the coefficients of (x + 1)ⁿ. For (a·x + b)ⁿ, each one is then multiplied by the right powers of a and b.

How many terms are in the expansion of (a + b)ⁿ?

n + 1. For example, (x + 1)⁵ has 6 terms.

How do I find the middle term?

If n is even, the middle term is term n ÷ 2 + 1, using k = n ÷ 2. If n is odd, there are two middle terms, with k = (n − 1) ÷ 2 and k = (n + 1) ÷ 2.

Related calculators