Understanding the binomial expansion calculator — concept and principle
This calculator expands (ax + b)ⁿ into a polynomial in x, listing every term from xⁿ down to the constant. It saves you from multiplying the bracket out n times by hand and is useful for algebra homework, probability (binomial distributions), approximations such as (1 + x)ⁿ ≈ 1 + nx, and checking coefficients in series work. The power n must be a whole number from 0 to 30.
How it is calculated
By the binomial theorem, (ax + b)ⁿ = Σ C(n, k) · aⁿ⁻ᵏ · bᵏ · xⁿ⁻ᵏ, summed over k = 0, 1, …, n.
- C(n, k) = n! ÷ (k!(n − k)!) is the binomial coefficient, the number of ways to choose k items from n.
- a is the coefficient of x, b is the constant term, and n is the exponent.
- The k-th term takes x from n − k of the brackets and b from the other k brackets.
The principle
Writing (ax + b)ⁿ as n identical brackets multiplied together, each term of the expanded product comes from picking either ax or b from every bracket. If you pick b from exactly k brackets, you get aⁿ⁻ᵏ bᵏ xⁿ⁻ᵏ, and there are C(n, k) different ways to choose which k brackets those are. Adding up all choices gives the theorem. The coefficients C(n, k) are exactly the numbers in row n of Pascal's triangle.
Worked example
- Default inputs: a = 2, b = 3, n = 4, so we expand (2x + 3)⁴.
- k = 0: C(4,0) · 2⁴ · 3⁰ = 1 · 16 · 1 = 16 → 16x^4.
- k = 1: C(4,1) · 2³ · 3¹ = 4 · 8 · 3 = 96 → 96x^3.
- k = 2: C(4,2) · 2² · 3² = 6 · 4 · 9 = 216 → 216x^2.
- k = 3: C(4,3) · 2¹ · 3³ = 4 · 2 · 27 = 216 → 216x.
- k = 4: C(4,4) · 2⁰ · 3⁴ = 81 → 81.
- Result: 16x^4 + 96x^3 + 216x^2 + 216x + 81.
How to read the result
Terms are listed from the highest power of x to the constant. A quick check: put x = 1. The coefficients must add up to (a + b)ⁿ; here 16 + 96 + 216 + 216 + 81 = 625 = 5⁴. If b is negative, the signs alternate and the calculator shows them with "−". For large n the coefficients grow very fast and are shown in rounded or exponential form.
Common mistakes
- Forgetting to raise a to its power: the first term of (2x + 3)⁴ is 16x⁴, not 2x⁴.
- Dropping the binomial coefficient and writing only aⁿ⁻ᵏ bᵏ.
- Losing the sign of a negative b: (x − 2)³ = x³ − 6x² + 12x − 8.
- Counting n terms instead of n + 1.
Frequently asked questions
How do I find just one term, such as the x² term?
Choose k so that n − k = 2. For (2x + 3)⁴ that is k = 2, giving 6 · 4 · 9 = 216.
How is this connected to probability?
In the binomial distribution, the chance of k successes in n trials is C(n, k) pᵏ(1 − p)ⁿ⁻ᵏ, which is one term of (p + (1 − p))ⁿ = 1.
What about (a + b + c)ⁿ?
That needs the multinomial theorem, whose coefficients are n! ÷ (i! j! k!).
Sources: NIST Digital Library of Mathematical Functions, §26.3 Lattice Paths: Binomial Coefficients (dlmf.nist.gov) · Graham, R. L., Knuth, D. E., Patashnik, O., Concrete Mathematics, Chapter 5