Stuck on a Binomial Expansion?
Maya is a first-year statistics student preparing for her midterm. One question asks her to expand (2 + 3)4 and list every term with its coefficient. She knows the answer should be 625, but she keeps losing track of which coefficient goes where. After her third attempt, the numbers blur together. Sound familiar? Expanding (a + b)n by hand gets tedious fast, and a single misplaced coefficient throws off the entire result. That is exactly the problem this binomial theorem calculator solves.
What This Calculator Does and Why It Matters
This tool expands (a + b)n using the binomial theorem. You enter numeric values for a, b, and n, and the calculator returns three things at once. First, the symbolic expansion using a and b as symbols with Pascal's triangle coefficients, such as a³ + 3a²b + 3ab² + b³. Second, the evaluated expansion with your numbers substituted, so you see the actual numeric value. Third, a term-by-term breakdown showing how each piece is computed.
There is also a Single Coefficient mode. If you only need one binomial coefficient C(n,k), you enter n and k and get the result with the factorial formula worked out step by step. Since binomial coefficients are combinations in disguise, you can learn more in our Combination Calculator. The factorials themselves are explained in our Factorial Calculator.
- Full Expansion mode: inputs a, b, and n; outputs the symbolic form, the evaluated numeric form, and each term broken down.
- Single Coefficient mode: inputs n and k; outputs C(n,k) with the factorial calculation shown.
How the Calculation Works
The binomial theorem states that for any non-negative integer n:
(a + b)n = Σ C(n,k) · an-k · bk for k = 0 to n
Each term in the expansion has three parts: a binomial coefficient C(n,k), a power of a, and a power of b. The coefficient counts how many ways you can choose k copies of b from n factors of (a + b). That is why the coefficient is a combination. The formula for the coefficient is:
C(n,k) = n! / (k! · (n - k)!)
Here n! means factorial, the product of all positive integers from 1 to n. For example, 4! = 4 × 3 × 2 × 1 = 24. By definition, 0! = 1.
Pascal's triangle gives you the same coefficients without any factorials. Each row of the triangle corresponds to a value of n. Row 0 is just 1. Row 1 is 1, 1. Row 2 is 1, 2, 1. Row 3 is 1, 3, 3, 1. Row 4 is 1, 4, 6, 4, 1. Each number is the sum of the two numbers directly above it. So for (a + b)³ the coefficients are 1, 3, 3, 1, giving a³ + 3a²b + 3ab² + b³.
The connection to combinations is direct. C(n,k) is the kth entry in row n of Pascal's triangle (counting from zero). It counts the number of ways to pick k items from n items. In the expansion, it counts how many of the n factors of (a + b) contribute a b instead of an a. For more on that counting logic, see the Combination Calculator.
How to Use the Calculator
- Pick a mode at the top: Full Expansion or Single Coefficient.
- For Full Expansion, enter values for a, b, and n. n must be a non-negative integer from 0 to 20.
- For Single Coefficient, enter n and k. Both must be non-negative integers, and k cannot exceed n.
- Read the symbolic expansion, the evaluated numeric result, and the step-by-step term breakdown on the right.
- Use the Copy Result button to save the output for your notes or homework.
Example Calculations
Example 1: Maya's midterm problem. She needs to expand (2 + 3)4. With a = 2, b = 3, and n = 4, the symbolic expansion is a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴. Substituting the numbers: 16 + 96 + 216 + 216 + 81 = 625. The term breakdown shows that the middle term, C(4,2) · 2² · 3² = 6 · 4 · 9 = 216, is the largest contributor. Maya now sees why the middle terms dominate when a and b are close in size.
Example 2: A probability check. Daniel is modeling 5 coin flips and wants the coefficient for exactly 3 heads. He switches to Single Coefficient mode and enters n = 5, k = 3. The calculator returns C(5,3) = 10, with the breakdown 5! / (3! · 2!) = 120 / (6 · 2) = 10. That tells him there are 10 sequences of 5 flips containing exactly 3 heads, which he combines with the probability of any single sequence to get his final answer.
Real-World Scenarios
Coin flips and the binomial distribution. The binomial theorem underpins the binomial distribution in statistics. If you flip a fair coin n times, the probability of getting exactly k heads is C(n,k) · (0.5)n. The coefficient C(n,k) counts the arrangements, and the powers handle the probability of each arrangement. This is how pollsters estimate margins of error and how quality engineers calculate defect rates.
Polynomial approximation in numerical analysis. The binomial theorem is a building block for Taylor series and binomial approximations. In physics and engineering, (1 + x)n is approximated by 1 + nx when x is small. That approximation comes straight from the first two terms of the binomial expansion. It shows up in relativity, fluid dynamics, and financial modeling.
Algebra and combinatorics coursework. Students encounter the binomial theorem in algebra, precalculus, and discrete math. Being able to check an expansion term by term builds confidence before exams. The step-by-step breakdown here mirrors the work a grader expects to see.
Common Mistakes to Avoid
- Swapping n-k and k. The power of a is n - k and the power of b is k. Reversing them gives the right total but labels each term incorrectly. The coefficients are symmetric, so the mistake is easy to miss.
- Using a negative or fractional n. The standard binomial theorem applies only to non-negative integer exponents. Negative or fractional exponents produce infinite series, not finite expansions. This calculator flags that as an error.
- Sign errors with (a - b)n. To expand (a - b)n, treat it as (a + (-b))n. The signs alternate because the odd powers of -b are negative. Forgetting the alternation is a classic slip.
- Forgetting that n = 0 gives 1. Any nonzero base to the power 0 is 1. The expansion has a single term, C(0,0) · a⁰ · b⁰ = 1. People sometimes expect a longer result.
Limitations
This calculator handles non-negative integer exponents up to 20. Beyond that, the coefficients and powers grow large enough to lose precision in standard floating-point arithmetic. It does not expand expressions with symbolic exponents like (a + b)x, and it does not produce the infinite series that arise from negative or fractional exponents. For multinomial expansions of (a + b + c)n, a different tool is needed. Factorials beyond 20! are still computed accurately here, but the combined term values may exceed safe integer precision, so results for large n are shown as floating-point approximations.
Authoritative Research and Resources
For a thorough video walkthrough of the binomial theorem and worked examples, Khan Academy's binomial theorem lesson covers the formula, Pascal's triangle, and practice problems. It is a solid starting point for students.
MIT OpenCourseWare provides a more rigorous treatment in its combinatorics and algebra materials. The MIT OpenCourseWare mathematics catalog includes lecture notes that connect the binomial theorem to broader topics in algebra and probability.
For a formal reference, Wolfram MathWorld's Binomial Theorem entry gives the precise statement, generalizations, and historical context. It is a good reference when you need the exact mathematical formulation.