Binomial Theorem Calculator
Expand a power of x plus y using binomial coefficients.
What it does
The binomial theorem gives a formula for expanding a power of a two term expression. Instead of multiplying (x + y) by itself many times, you can write down each term directly using binomial coefficients.
Montana State University's teaching notes describe the theorem as the general expansion of (x + y) to the power n, where each coefficient counts the number of ways to choose k objects from a set of n. Yale University notes give the same definition of n choose k and connect it to the binomial distribution.
The coefficient of the term with x to the power n minus k and y to the power k is n choose k, calculated as n factorial divided by k factorial times n minus k factorial. The first and last coefficients are always one.
This tool prints the expansion for a power from 0 to 30, lists the coefficients and counts the terms. The arithmetic uses exact integers, so even the largest supported expansion is free of rounding error.
The pattern of coefficients forms Pascal's triangle. Each row starts and ends with one, and every other entry is the sum of the two entries above it.
How to use
- Enter a whole number power from 0 to 30.
- Read the expansion in the main result, written in descending powers of x.
- Check the number of terms, which is one more than the power.
- Look at the coefficient list to see a row of Pascal's triangle.
- Try powers 2, 3 and 4 to see the familiar coefficients 1 2 1, 1 3 3 1 and 1 4 6 4 1.
- Add the coefficients and confirm the sum equals 2 to the power n.
Formula
- n
- The power, a whole number from 0 to 30.
- k
- The term index, running from 0 to n.
- C(n,k)
- The binomial coefficient, read as n choose k.
- x, y
- The two terms of the binomial being expanded.
The engine computes each coefficient with a running product and division, using exact big integers. That avoids the overflow a factorial table would cause for larger powers. The term k = 0 is written as x to the power n, and the term k = n as y to the power n.
Worked example
Example: expanding (x + y) to the fourth power
Enter n = 4 to expand (x + y)^4.
- The expansion has 4 + 1 = 5 terms.
- The coefficients are C(4,0) = 1, C(4,1) = 4, C(4,2) = 6, C(4,3) = 4 and C(4,4) = 1.
- The first term is x^4 and the last term is y^4.
- The middle terms are 4x^3y, 6x^2y^2 and 4xy^3.
- The tool writes x^4 + 4x^3y^1 + 6x^2y^2 + 4x^1y^3 + y^4.
- The coefficients add to 16, which is 2^4.
- The list 1, 4, 6, 4, 1 is row 4 of Pascal's triangle.
Reference table
| Power n | Coefficients | Sum |
|---|---|---|
| 2 | 1, 2, 1 | 4 |
| 3 | 1, 3, 3, 1 | 8 |
| 4 | 1, 4, 6, 4, 1 | 16 |
| 5 | 1, 5, 10, 10, 5, 1 | 32 |
| 6 | 1, 6, 15, 20, 15, 6, 1 | 64 |
Limits
- The power is capped at 30 so the printed expansion stays readable.
- The tool expands symbolic x and y. It does not substitute numbers for them.
- Very large powers produce long strings that may wrap on a narrow screen.
- Only nonnegative whole number powers are handled.
Common mistakes
- Expecting n terms rather than n + 1 terms.
- Assuming the coefficients are all one because the first and last are.
- Using 2n as the sum of coefficients instead of 2 to the power n.
- Forgetting that the powers of x fall while the powers of y rise.
- Trying to use the tool for negative or fractional powers, which need a different series.
Try it yourself
Quick checks. Answers sit tucked under each question.
Expand (x + y) to the power 4.
x^4 + 4x^3y + 6x^2y^2 + 4xy^3 + y^4, with coefficients 1, 4, 6, 4, 1.
How many terms are in the expansion for n = 30?
31 terms, because the expansion always has n + 1 terms.
What is the sum of the coefficients for n = 5?
32, which is 2 to the power 5.
Questions
What is the binomial theorem?
A formula that expands (x + y) to the power n into a sum of terms whose coefficients are binomial coefficients.
What does n choose k mean?
The number of ways to pick k items from n, calculated as n! divided by k! times (n-k)!.
How is this related to Pascal's triangle?
Each row of Pascal's triangle is the list of coefficients for one power of the binomial.
Why do coefficients add to 2 to the power n?
Setting x = 1 and y = 1 in the expansion gives (1 + 1)^n, which equals the sum of the coefficients.
Can the tool handle symbolic coefficients on x and y?
No. It expands the plain expression x + y. For (ax + by)^n you can multiply each coefficient by a raised to n-k and b raised to k.
What about negative powers?
They need the generalised binomial series, which this tool does not implement.
Sources
- Montana State University, The Binomial Theorem teaching notes
- Yale University, Things binomial, Stat 241 notes