Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Value of (a + b)n
16
sum of all expansion terms
Number of terms 5
Sum of terms (check) 16
C(4,0)=1 -> term 0 = 1.000 + C(4,1)=4 -> term 1 = 4.000 + C(4,2)=6 -> term 2 = 6.000 + C(4,3)=4 -> term 3 = 4.000 + C(4,4)=1 -> term 4 = 1.000

What is the Binomial Expansion Calculator?

This tool expands the expression \((a + b)^{n}\) using the binomial theorem. It returns the numeric value of the expression, the number of terms produced, and a full list of every binomial coefficient \(C(n,k)\) together with each individual term. It works for any non-negative integer exponent up to 20 and any real coefficients a and b.

How to use it

Enter the first term coefficient a, the second term coefficient b, and the exponent n. Press calculate. The hero box shows the total value of \((a + b)^{n}\), while the table confirms the term count and the sum of all expanded terms (which must equal that value). The expansion box lists each coefficient and term so you can check your algebra.

The formula explained

The binomial theorem states that \((a + b)^{n}\) equals the sum from k = 0 to n of \(C(n,k) \cdot a^{n-k} \cdot b^{k}\). The general form is:

$$\left(a + b\right)^{n} = \sum_{k=0}^{n} \binom{n}{k}\, a^{\,n-k}\, b^{\,k}$$

The coefficients \(C(n,k)\) form a row of Pascal triangle. We compute them efficiently with the recurrence \(C(n,k) = C(n,k-1) \cdot (n - k + 1) / k\), avoiding large factorials.

Diagram showing the binomial expansion formula with labeled coefficient, exponents and summation
Each term of (a+b)^n combines a binomial coefficient with descending powers of a and ascending powers of b.

Worked example

For \((1 + 1)^{4}\): the coefficients are 1, 4, 6, 4, 1. Each term equals the coefficient since a = b = 1, so the expansion is $$1 + 4 + 6 + 4 + 1 = 16,$$ which matches \(2^{4} = 16\). The calculator produces 5 terms and a value of 16.

Pascal's triangle of binomial coefficients shown as a flat numeric triangle
The binomial coefficients C(n,k) form the rows of Pascal's triangle.

Pascal's Triangle Reference (Rows n = 0 to 10)

Each row \(n\) of Pascal's triangle lists the binomial coefficients \(\binom{n}{k}\) for \(k = 0, 1, \dots, n\). These are exactly the coefficients that appear when expanding \((a+b)^n\). Every interior entry equals the sum of the two entries directly above it, and the entries in each row sum to \(2^n\).

\(n\) Coefficients \(\binom{n}{0}, \binom{n}{1}, \dots, \binom{n}{n}\) Row sum \(2^n\)
0 1 1
1 1, 1 2
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
7 1, 7, 21, 35, 35, 21, 7, 1 128
8 1, 8, 28, 56, 70, 56, 28, 8, 1 256
9 1, 9, 36, 84, 126, 126, 84, 36, 9, 1 512
10 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1 1024

For example, the middle coefficient in row 10 is 252, found at \(k=5\). Each row is symmetric because \(\binom{n}{k} = \binom{n}{n-k}\).

More Worked Examples

Example 1: \((x+2)^3\)

Here \(a=x\), \(b=2\), and \(n=3\). The row-3 coefficients are \(1, 3, 3, 1\). Substitute into \(\sum_{k=0}^{3}\binom{3}{k}x^{3-k}2^{k}\):

$$\binom{3}{0}x^3(2)^0 + \binom{3}{1}x^2(2)^1 + \binom{3}{2}x^1(2)^2 + \binom{3}{3}x^0(2)^3$$$$= 1\cdot x^3 + 3\cdot x^2\cdot 2 + 3\cdot x\cdot 4 + 1\cdot 8 = x^3 + 6x^2 + 12x + 8$$

The powers of \(x\) descend \(3 \to 0\) while the powers of \(2\) ascend \(0 \to 3\).

Example 2: \((2a-b)^4\) — alternating signs

Write the subtraction as \(b \to -b\), so the base terms are \(2a\) and \(-b\), with \(n=4\) and coefficients \(1, 4, 6, 4, 1\):

$$\sum_{k=0}^{4}\binom{4}{k}(2a)^{4-k}(-b)^{k}$$$$= 1(2a)^4 + 4(2a)^3(-b) + 6(2a)^2(-b)^2 + 4(2a)(-b)^3 + 1(-b)^4$$$$= 16a^4 - 32a^3 b + 24a^2 b^2 - 8a b^3 + b^4$$

Because \((-b)^k\) is negative for odd \(k\) and positive for even \(k\), the signs alternate \(+,-,+,-,+\).

Example 3: \((x+1)^6\) — explicit ascending/descending powers

With \(a=x\), \(b=1\), \(n=6\), the row-6 coefficients are \(1, 6, 15, 20, 15, 6, 1\). Since every power of \(1\) is \(1\), the coefficients appear directly:

$$(x+1)^6 = x^6 + 6x^5 + 15x^4 + 20x^3 + 15x^2 + 6x + 1$$

The central coefficient \(20\) equals 20, i.e. \(\binom{6}{3}\). The exponent on \(x\) descends from \(6\) to \(0\) across the seven terms.

Key Terms & Variables

\(a\) — first base term
The first quantity inside the binomial \((a+b)^n\). In each expanded term it is raised to the descending power \(a^{n-k}\).
\(b\) — second base term
The second quantity inside the binomial. It is raised to the ascending power \(b^{k}\). For a subtraction \((a-b)^n\), treat \(b\) as negative so signs alternate.
\(n\) — exponent (degree)
The power to which the binomial is raised. For a non-negative integer \(n\), the expansion has exactly \(n+1\) terms, and \(n\) selects row \(n\) of Pascal's triangle.
\(k\) — summation index
The counter that runs from \(0\) to \(n\) in \(\sum_{k=0}^{n}\). It identifies each term's position and sets the powers \(a^{n-k}b^{k}\).
\(\binom{n}{k}\) — binomial coefficient
Read \"n choose k,\" computed as \(\binom{n}{k} = \dfrac{n!}{k!\,(n-k)!}\). It is the numerical multiplier (also the count of ways to choose \(k\) items from \(n\)) on the term with index \(k\).
A single term
One complete summand of the form \(\binom{n}{k}\,a^{n-k}\,b^{k}\): a coefficient multiplied by a power of \(a\) and a power of \(b\), whose exponents always add to \(n\).

FAQ

Can n be a fraction or negative? This calculator supports non-negative integer exponents (0 to 20), where the expansion has exactly \(n + 1\) terms.

What does the sum-of-terms row mean? It adds up every expanded term as a sanity check; it should always equal the reported value of \((a + b)^{n}\).

Why does the coefficient list use C(n,k)? \(C(n,k)\) is the standard binomial coefficient notation, equal to \(n! / (k!(n-k)!)\), giving the multiplier on each term.

Last updated: