Binomial Expansion Calculator

Expand (a + b)n step by step using the binomial theorem. View the full symbolic expansion, numerical evaluation, coefficient table, and an interactive Pascal's triangle visualization.

Enter real numbers for a and b, and a non‑negative integer for n (0 ≤ n ≤ 30).
(x+1)^5
(2x-3)^4
(1+1)^3
(1+x)^10
(0.5+2)^6
Privacy first: All calculations run locally in your browser. No data is sent to any server.

Understanding the Binomial Theorem

The binomial theorem provides a formula for expanding powers of a binomial — an algebraic expression with two terms. It states that for any non‑negative integer n,

(a + b)n = ∑k=0n C(n, k) · an−k · bk

where C(n, k) = n! / (k! · (n−k)!) is the binomial coefficient, also known as the combination number. These coefficients form the rows of Pascal's triangle, one of the most elegant and ancient patterns in mathematics.

A Brief History

The binomial theorem has roots in ancient Indian, Greek, and Chinese mathematics. The Persian mathematician Al-Karaji (c. 1000 CE) described the triangular array of coefficients, and the Chinese mathematician Yang Hui (c. 1238–1298) independently illustrated it. In the West, Blaise Pascal (1623–1662) famously studied the triangle that now bears his name, though it had been known centuries earlier.

Isaac Newton (1643–1727) generalised the theorem to rational and negative exponents, laying the groundwork for infinite series and calculus. Today, the binomial theorem is a cornerstone of algebra, combinatorics, probability, and numerical analysis.

Why Use This Calculator?

  • Educational clarity: See the expansion step by step with coefficients, exponents, and numerical values side by side.
  • Visual learning: Pascal's triangle reveals the pattern of coefficients in a way that pure algebra cannot.
  • Error checking: Verify your own hand‑expansions quickly and reliably.
  • Practical applications: From probability distributions (binomial distribution) to polynomial approximations and series expansions.

How the Expansion Works

To expand (a + b)n, we sum over k from 0 to n. For each term:

  • Coefficient: C(n, k) — the number of ways to choose k items from n.
  • Power of a: n − k — decreases from n to 0.
  • Power of b: k — increases from 0 to n.

The total number of terms is n + 1. For example, (a + b)3 = a3 + 3a2b + 3ab2 + b3, with coefficients 1, 3, 3, 1 — exactly the 4th row of Pascal's triangle.

Key Properties & Special Cases

Case Expansion Comment
n = 0 (a + b)0 = 1 Any non‑zero base to the 0th power is 1.
n = 1 a + b Trivial case.
n = 2 a2 + 2ab + b2 Perfect square trinomial.
n = 3 a3 + 3a2b + 3ab2 + b3 Cube of a sum.
a = 0 (0 + b)n = bn Only the last term survives.
b = 0 (a + 0)n = an Only the first term survives.
a = b = 1 (1 + 1)n = 2n Sum of all coefficients = 2n.
Case Study: Binomial Distribution in Probability

The binomial theorem is the foundation of the binomial distribution, which models the number of successes in n independent trials. For a probability p of success, the probability of exactly k successes is C(n, k) · pk · (1−p)n−k. This is precisely the k‑th term of (p + (1−p))n = 1. Our calculator can be used to generate these probabilities by setting a = p and b = 1−p.

For example, with n = 4, p = 0.3, we get (0.3 + 0.7)4 = 0.0081 + 0.0756 + 0.2646 + 0.4116 + 0.2401 = 1. Each term corresponds to P(X = k) for k = 0,1,2,3,4. This makes the binomial theorem indispensable in statistics and data science.

Common Misconceptions

  • “The coefficients are always positive.” — Only if a and b are positive. If either is negative, terms alternate in sign.
  • “The binomial theorem only works for positive integers.” — Newton generalised it to all real exponents (infinite series).
  • “Pascal's triangle is just for coefficients.” — It also encodes combinations, Fibonacci numbers, and many other patterns.
  • “The expansion has n terms.” — It has n + 1 terms, not n.

Applications Across Disciplines

  • Combinatorics: Counting subsets, arrangements, and combinations.
  • Probability & Statistics: Binomial distribution, hypothesis testing, and confidence intervals.
  • Numerical Analysis: Polynomial interpolation, series expansions, and approximation of functions.
  • Physics: Quantum mechanics (probability amplitudes), statistical mechanics (partition functions).
  • Computer Science: Algorithm analysis, generating functions, and combinatorics of data structures.

Step‑by‑Step Derivation

The binomial theorem can be proven by mathematical induction on n. For n = 0, the statement is trivial. Assume it holds for n, then for n+1:

(a + b)n+1 = (a + b) · (a + b)n
= (a + b) · ∑k=0n C(n, k) an−k bk
= ∑k=0n C(n, k) an+1−k bk + ∑k=0n C(n, k) an−k bk+1
= ∑k=0n+1 [C(n, k) + C(n, k−1)] an+1−k bk
= ∑k=0n+1 C(n+1, k) an+1−k bk

The identity C(n, k) + C(n, k−1) = C(n+1, k) is the fundamental recurrence that builds Pascal's triangle. This elegant proof connects algebra, combinatorics, and induction in a single sweep.

Frequently Asked Questions

The binomial theorem is used to expand powers of binomials, compute combinations, derive probability distributions, approximate functions (Taylor series), and solve problems in algebra, combinatorics, and statistics.

Yes, Newton's generalised binomial theorem extends the formula to all real exponents, producing an infinite series. This calculator focuses on non‑negative integers n, which is the most common educational use case.

Binomial coefficients are the numbers that appear in the expansion of (a+b)ⁿ. They are denoted C(n,k) and count the number of ways to choose k items from a set of n. They also form Pascal's triangle.

Each row of Pascal's triangle contains the binomial coefficients for a given n. The triangle is built by adding adjacent numbers from the row above, which is exactly the recurrence C(n,k) = C(n−1,k−1) + C(n−1,k).

The calculator uses double‑precision floating point arithmetic, which is accurate to about 15 decimal digits. For extremely large n (≥ 20), coefficients may exceed the safe integer range; we use floating‑point for display and BigInt internally where possible.

Excellent resources include Wolfram MathWorld, Khan Academy, and the classic texts Concrete Mathematics by Graham, Knuth, and Patashnik.

Built on classical foundations – This tool implements the binomial theorem as formalised by Newton and Pascal. The code follows IEEE 754 standards for floating‑point arithmetic and has been verified against symbolic algebra systems. Reviewed by the GetZenQuery tech team, last updated July 2026.

References: MathWorld Binomial Theorem; Graham, R. L., Knuth, D. E., & Patashnik, O. Concrete Mathematics (1994); Wikipedia: Binomial Theorem.