acalculator

What is the binomial theorem result?

Type the two terms a and b and the power n. The binomial theorem calculator lists the binomial coefficients, works out every term C(n, k) a^(n−k) b^k, adds them into the expansion, and shows any one term on its own.

Your numbers

(a + b)^n
x^5 + 5x^4 y + 10x^3 y^2 + 10x^2 y^3 + 5x y^4 + y^5

The expansion has 6 terms: x^5 + 5x^4 y + 10x^3 y^2 + 10x^2 y^3 + 5x y^4 + y^5.

Binomial coefficients
1, 5, 10, 10, 5, 1
Number of terms
6
Each term
Term 1: C(5, 0) × x⁵ × y⁰ = x⁵; Term 2: C(5, 1) × x⁴ × y¹ = 5x⁴ y; Term 3: C(5, 2) × x³ × y² = 10x³ y²; Term 4: C(5, 3) × x² × y³ = 10x² y³; Term 5: C(5, 4) × x¹ × y⁴ = 5x y⁴; Term 6: C(5, 5) × x⁰ × y⁵ = y⁵

(a + b)^n: x^5 + 5x^4 y + 10x^3 y^2 + 10x^2 y^3 + 5x y^4 + y^5. The expansion has 6 terms: x^5 + 5x^4 y + 10x^3 y^2 + 10x^2 y^3 + 5x y^4 + y^5.

How is each term found?

How to calculate

Expands (a + b)^n by the binomial theorem, with the binomial coefficients, every term C(n, k) a^(n−k) b^k, and any one term on its own, in exact fractions.

Example with the default inputs (First term a x, Second term b y, Power n 5): The expansion has 6 terms: x^5 + 5x^4 y + 10x^3 y^2 + 10x^2 y^3 + 5x y^4 + y^5.

Method: (a + b)^n = Σ C(n, k) a^(n−k) b^k, k = 0 to n, with C(n, k) = n! ÷ (k!(n − k)!); term k + 1 is C(n, k) a^(n−k) b^k.

  • a and b are single terms that are not like terms. Coefficients are exact fractions: 0.5 is 1/2.
  • n is a whole number from 0 to 30.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. First term a x, Second term b y, Power n 5 gives (a + b)^n x^5 + 5x^4 y + 10x^3 y^2 + 10x^2 y^3 + 5x y^4 + y^5, Binomial coefficients 1, 5, 10, 10, 5, 1, Number of terms 6.Source: OpenStax, Algebra and Trigonometry 2e, §13.6 Binomial Theorem, Example 2a ((x + y)⁵ = x⁵ + 5x⁴y + 10x³y² + 10x²y³ + 5xy⁴ + y⁵), https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-6-binomial-theorem
  2. First term a 3x, Second term b -y, Power n 4, Show term number 2 gives (a + b)^n 81x^4 - 108x^3 y + 54x^2 y^2 - 12x y^3 + y^4, Chosen term −108x³ y.Source: OpenStax, Algebra and Trigonometry 2e, §13.6 Binomial Theorem, Example 2b ((3x − y)⁴ = 81x⁴ − 108x³y + 54x²y² − 12xy³ + y⁴), https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-6-binomial-theorem
  3. First term a x, Second term b 2y, Power n 16, Show term number 10 gives Chosen term 5857280x⁷ y⁹, Number of terms 17.Source: OpenStax, Algebra and Trigonometry 2e, §13.6 Binomial Theorem, Example 3 (the tenth term of (x + 2y)¹⁶ is 5,857,280x⁷y⁹), https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-6-binomial-theorem
  4. First term a x, Second term b 0.5, Power n 3 gives (a + b)^n x^3 + 3x^2/2 + 3x/4 + 1/8, Each term Term 1: C(3, 0) × x³ × (1/2)⁰ = x³; Term 2: C(3, 1) × x² × (1/2)¹ = 3x²/2; Term 3: C(3, 2) × x¹ × (1/2)² = 3x/4; Term 4: C(3, 3) × x⁰ × (1/2)³ = 1/8.

How it works

For whole n ≥ 0:

  • Binomial coefficient: C(n, k) = n! ÷ (k!(n − k)!), worked out exactly.
  • Term k + 1 (k = 0 to n): C(n, k) × a^(n−k) × b^k.
  • Expansion: (a + b)^n = the sum of the n + 1 terms.
  • Chosen term r (1 to n + 1): C(n, r − 1) × a^(n−r+1) × b^(r−1).

Input. a and b are each one term: a number, letters a to z except e, whole powers and products, such as 3x, −y, 2, x^2 or x/2. A minus sign belongs to its term: (3x − y)^4 is a = 3x, b = −y. a and b may not be like terms (the same letters to the same powers, such as x and 2x, or two numbers); the page then says to add them first. n is a whole number from 0 to 30. The term number r is optional; when given it must be 1 to n + 1.

Exact arithmetic. Every coefficient is an exact fraction: 0.5 is 1/2, so (x + 0.5)^3 has the term 3x/4.

Output format. The expansion is written with the highest total power first, then letters in alphabetical order, then the number; a fraction comes after the letters (3x^2/2). Letters in a product are separated by a space (5x^4 y). The chosen term is written the same way, with powers as superscripts and a true minus sign (−108x³ y). The coefficients are C(n, 0) to C(n, n), separated by commas. The steps list each term as C(n, k) × a^(n−k) × b^k, with a or b in brackets when it is negative, a fraction, or more than one factor, powers as superscripts (including the powers 0 and 1) and true minus signs.

Worked examples by hand

(x + y)^5 (OpenStax Example 2a). The coefficients are 1, 5, 10, 10, 5, 1, so (x + y)^5 = x^5 + 5x^4y + 10x^3y^2 + 10x^2y^3 + 5xy^4 + y^5.

(3x − y)^4 (OpenStax Example 2b). With a = 3x and b = −y: 1 × 81x^4, 4 × 27x^3 × (−y) = −108x^3y, 6 × 9x^2 × y^2 = 54x^2y^2, 4 × 3x × (−y^3) = −12xy^3, 1 × y^4. Term 2 is −108x^3y.

Tenth term of (x + 2y)^16 (OpenStax Example 3). r = 10, so k = 9: C(16, 9) = 11,440 and (2y)^9 = 512y^9. 11,440 × 512 = 5,857,280x^7y^9. The expansion has 17 terms.

(x + 0.5)^3. Coefficients 1, 3, 3, 1; b = 1/2. Terms x^3, 3x^2 × 1/2 = 3x^2/2, 3x × 1/4 = 3x/4, 1/8: x^3 + 3x^2/2 + 3x/4 + 1/8.

Other questions people ask

What is the binomial theorem?

For a whole number n, (a + b)^n = C(n, 0)a^n + C(n, 1)a^(n−1)b + … + C(n, n)b^n. Each term is C(n, k) a^(n−k) b^k for k = 0 to n, so there are n + 1 terms.

How do I work out a binomial coefficient?

C(n, k) = n! ÷ (k!(n − k)!). For example C(5, 3) = 120 ÷ (6 × 2) = 10. The coefficients of (a + b)^n are row n of Pascal’s triangle: 1, 5, 10, 10, 5, 1 for n = 5.

How do I find one term without expanding everything?

Term number r + 1 is C(n, r) a^(n−r) b^r. The tenth term of (x + 2y)^16 has r = 9: C(16, 9) x^7 (2y)^9 = 11,440 × 512 x^7 y^9 = 5,857,280x^7y^9.

What happens with a minus sign, as in (3x − y)^4?

Take b = −y. Odd powers of −y are negative, so the signs alternate: 81x^4 − 108x^3y + 54x^2y^2 − 12xy^3 + y^4.

Why must a and b be single terms?

The theorem is for a binomial, a sum of two terms. If a or b is itself a sum, expand it in stages, or use the polynomial or combine like terms calculator. If a and b are like terms (x and 2x), add them first: (3x)^n.

What is the largest power the calculator takes?

n can be 0 to 30. The answer then has up to 31 terms, and every coefficient is exact.