BINOMIAL EXPANSION CALCULATOR

Binomial expansion calculator

Expand (ax + b)ⁿ, find a single term or the coefficient of any power of x.

a and b can be whole numbers, decimals or fractions like 1/2. Leave a box empty to skip it. If both are filled, the answer shown is the coefficient of that power of x.

What is the binomial theorem?

It gives the expansion of a sum raised to a whole-number power: (a + b)ⁿ = Σ C(n, k)·aⁿ⁻ᵏ·bᵏ for k = 0 to n, where C(n, k) = n! ÷ (k!(n − k)!) is the binomial coefficient. It saves you from multiplying the bracket by itself n times (OpenStax College Algebra 2e, section 9.6). Here the first term is ax and the second is b, so term k + 1 is C(n, k)·(ax)ⁿ⁻ᵏ·bᵏ.

How do I find one term without expanding everything?

Use the term number to pick k: the r-th term has k = r − 1. For the sixth term of (3x − 1)⁹, k = 5, so the term is C(9, 5)·(3x)⁴·(−1)⁵ = 126 × 81x⁴ × (−1) = −10,206x⁴. The tenth term of (x + 2)¹⁶ is C(16, 9)·x⁷·2⁹ = 5,857,280x⁷, the OpenStax example with y set to 1.

How do I find the coefficient of a particular power?

The power of x in term k + 1 is n − k, so for xᵐ take k = n − m. In (2x + 3)⁷ the coefficient of x⁴ has k = 3: C(7, 3)·2⁴·3³ = 35 × 16 × 27 = 15,120. Type the exponent into “Coefficient of x^”, and the calculator picks the right term for you.

What is the sum of the coefficients?

Put x = 1 in the bracket: the sum of all coefficients of (ax + b)ⁿ is (a + b)ⁿ. For (2x − 3)⁷ it is (2 − 3)⁷ = −1. The calculator prints this as a quick check of the expansion: add up your coefficients by hand and compare. With a = b = 1 the sum is 2ⁿ, the sum of a row of Pascal’s triangle.

Why do the signs alternate when b is negative?

Because bᵏ is negative when k is odd. For (3x − 1)⁴ the coefficients are 81, −108, 54, −12, 1: positive for even k and negative for odd k. If both a and b are negative, the signs depend on n − k and k together, so write the bracket as −(|a|x + |b|)ⁿ if that is easier to follow.

What is the difference between this and Pascal’s triangle?

Pascal’s triangle lists the binomial coefficients C(n, k) row by row, and it is what you use when a = b = 1. This calculator multiplies in the powers of a and b as well, which is what an exam question like “expand (2x − 3)⁶” needs, and it finds single terms for large n where writing the triangle would take pages. See the Pascal’s triangle calculator for the coefficient table itself.

Does it work for negative or fractional exponents?

No. The finite formula is for whole n ≥ 0. For a negative or fractional power such as (1 + x)⁻² or √(1 + x) the expansion goes on forever and is a power series valid only for small |x|; use the Taylor series calculator for that.

The formula, with every symbol

For (ax + b)ⁿ, term number r + 1 (counting from 1, in descending powers of x) is C(n, r) · (ax)ⁿ⁻ʳ · bʳ. C(n, r) counts the ways to choose which r of the n brackets contribute b instead of ax. The a is raised to the same power as x, which is why the coefficient is C(n, r) · aⁿ⁻ʳ · bʳ and not C(n, r) · a · bʳ. The coefficient of the term in xᵐ is C(n, n − m) · aᵐ · bⁿ⁻ᵐ.

Worked example

Expand (3x − 1)⁴. The row of coefficients for n = 4 is 1, 4, 6, 4, 1. Multiply each by (3x)^(4−k) and (−1)^k: 1 · 81x⁴, 4 · 27x³ · (−1), 6 · 9x² · 1, 4 · 3x · (−1) and 1 · 1. That gives 81, −108, 54, −12, 1 for x⁴, x³, x², x and the constant: 81x⁴ − 108x³ + 54x² − 12x + 1. Check with x = 1: 81 − 108 + 54 − 12 + 1 = 16, and (3 − 1)⁴ = 16. With fractions, the third term of (x/2 − 2)⁶ is C(6, 2)·(x/2)⁴·(−2)² = (15/4)x⁴. For large n, the middle coefficient of (x + 1)¹⁰⁰ is C(100, 50) = 100,891,344,545,564,193,334,812,497,256.

Common mistakes

Forgetting to raise the numerical part of the first term to the power: (3x)⁴ is 81x⁴, not 3x⁴. Dropping the sign of a negative b. Being off by one between the term number and k (the first term has k = 0, so term r has k = r − 1). Mixing the order: this page counts terms in descending powers of x, as the OpenStax examples do; a textbook that writes the bracket as (b + ax)ⁿ and counts ascending powers numbers the terms from the other end, so term r there is term n + 2 − r here.

Limits

The exponent must be a whole number from 0 to 1000, and a and b must be exact numbers (whole, decimal or fraction, up to 12 digits each). All arithmetic is exact, so coefficients with hundreds of digits are shown in full, and very long ones are shortened with their digit count. The page expands the full polynomial only up to n = 40; beyond that it still finds any single term, the middle term and the sum of coefficients. A single letter x is used for the variable; for two letters, as in (x + y)ⁿ, set the other letter to 1 or use the Pascal’s triangle calculator.

Sources: OpenStax, College Algebra 2e, section 9.6 “Binomial Theorem” (Examples 1 to 3 are automated tests of this calculator). Related: Pascal’s triangle calculator, permutation and combination calculator, factorial calculator, binomial probability calculator, polynomial calculator and Taylor series calculator.