gizmobench
BrowseDaily

Binomial Expansion Calculator

Enter a binomial such as (2x + 3)^12 to see its exact polynomial and the factors that produce each term. Choose Whole expansion for every coefficient, or One term to find a coefficient by its power of x or its position, counting from the highest power. In One term mode, the middle-term buttons select the central position or both central positions in turn. Integer and fractional coefficients stay exact. This calculator accepts a linear bracket in one variable and whole-number exponents from 0 to 100; it does not calculate fractional-power or negative-power series.

expressionn = 3
(2x + 3)^3

a = 2    b = 3    n = 3
C(3,k)   1  3  3  1
expansion4 terms
k=0    1 (2x)^3      =   8x^3
k=1    3 (2x)^2 (3)  =  36x^2
k=2    3 (2x) (3)^2  =    54x
k=3    1 (3)^3       =     27

8x^3 + 36x^2 + 54x + 27
Show
Terms
4
Exponent
3
Leading
8x³
Constant
27

Degree 3, 4 terms: each coefficient is C(3,k) times 2^(3-k) times 3^k, with k running from 0 to 3.

  • (2x + 3)³full expansion
    8x³ + 36x² + 54x + 27
  • (x - 2)⁴alternating signs
    x⁴ - 8x³ + 24x² - 32x + 16
  • (2x + 3)¹⁰, the x³ term onlyone term, computed directly
    2,099,520 x³
Accuracy. Exact expansion of (ax + b)^n: binomial coefficients are computed as big integers and a and b are kept as exact fractions, so whole inputs give whole coefficients and nothing is rounded anywhere in the chain, at any exponent up to 100. A single requested term is computed directly from C(n, k) rather than by expanding everything and reading one line off, so it is still exact where the whole expansion would be too long to print. An exponent of 0 returns 1 by the empty product convention, and the page states that beside the answer.

The coefficient table

Each row is one value of k, from 0 at the highest power of x down to 3 at the constant. The term in the last column is the three things before it multiplied together, which is the binomial theorem written out rather than quoted.

kC(3,k)power of axpower of bterm
01(2x)^318x³
13(2x)^2(3)36x²
23(2x)(3)^254x
311(3)^327

How this is worked out

The binomial theorem says that (ax + b) raised to n is the sum, for k from 0 to n, of C(n,k) times (ax) to the (n minus k) times b to the k. C(n,k) is built here by the multiplicative rule, one exact division at a time, so no factorial of 100 is ever formed and every C(n,k) is a whole number rather than a rounded one.

The coefficients a and b are held as a numerator over a denominator, both whole numbers, and multiplied as fractions. Nothing is rounded, so a half stays a half and a coefficient of forty digits keeps its last digit. A decimal you type is read as the fraction it is: 0.5 becomes 1/2 before anything is raised to a power.

Asking for one term takes a different route. The coefficient of a chosen power is C(n,k) times a to that power times b to the rest, computed on its own, which is why a single term still comes back for an exponent whose whole expansion would be far too long to put on a page.

What you can type

A bracket raised to a power: (2x + 3)^12. Inside the bracket, one letter for the variable, whole numbers, fractions such as 2/3, decimals such as 0.5, the signs + - * / and brackets. The power may be written with a caret, with two stars, or raised, so (2x + 3)^12 and (2x + 3)**12 read the same. It runs from 0 to 100. The bracket has to be linear for this calculator: a squared term inside it is refused by name rather than guessed at. Letter case matters, so x and X are different variables. Numbers for a and b carry up to 12 digits, and the box is read up to 200 characters. Powers are typed with a caret and the answer prints them raised, which is the same polynomial written two ways: Copy keeps the caret so it pastes back into anything.

Common questions

What is the binomial expansion formula?
For a nonnegative integer n, (ax + b) raised to n is the sum, for k running from 0 to n, of C(n, k) times (ax) to the power n minus k, times b to the power k. C(n, k) is the number of ways of choosing k things from n, and it is the row of Pascal's triangle for that n. This page prints one line for each k with those three factors side by side, so (2x + 3)^3 comes out as 8x^3 + 36x^2 + 54x + 27 with the 1, 3, 3, 1 row visible beside it.
How do I find the coefficient of x^5 without expanding the whole thing?
Use the single term and give it the power you want. The coefficient of x to the power p in (ax + b)^n is C(n, n - p) times a to the p times b to the n minus p, which is one multiplication rather than a whole expansion. The coefficient of x^3 in (2x + 3)^10 is 2,099,520, computed here from C(10, 7) times 2^3 times 3^7 and nothing else. Because it takes that route, a term still comes back for a bracket whose full expansion would run past the 20,000 characters this page will print.
What is the 4th term of (2x + 3)^12, and why is k not 4?
It is 3,041,280 x⁹, which the page prints in the readout the way it prints any term. Terms are numbered from 1 at the highest power, while k in the formula counts the power of b and starts at 0, so the 4th term is k = 3: C(12, 3) times 2^9 times 3^3, which is 220 times 512 times 27. Mixing up the term number and k is the usual slip here, so the page shows both, and you can ask for a term either way and get the same answer.
Why do the signs alternate in an expansion like (x - 2)^4?
Because b is negative, and b to an odd power stays negative while b to an even power turns positive. (x - 2)^4 is x^4 - 8x^3 + 24x^2 - 32x + 16: the terms with an odd power of -2 are subtracted, the rest are added. Nothing special is done to the signs here. The negative b is carried through the arithmetic and the printed polynomial spells out whichever sign each term ended up with.
What does an exponent of 0 give?
1. This calculator uses the empty product convention, so (2x + 3)^0 is 1 and the expansion has a single term. The page states the convention beside the answer and applies it even where a and b are both 0.
Does it keep fractions exact, or turn them into decimals?
Exact. Every coefficient is a whole-number numerator over a whole-number denominator and is never converted to a decimal, so (x/2 + 1/3)^4 is printed as (1/16)x^4 + (1/6)x^3 + (1/6)x^2 + (2/27)x + 1/81. A decimal you type is read the other way, so 0.5 becomes 1/2 before anything is raised to a power. A fractional coefficient is printed inside brackets, as (1/16)x^4, so it cannot be misread as 1 over 16x^4.
How large can the exponent be, and is the answer still exact?
Exponents run from 0 to 100, which is 101 terms at the top of the range, and every coefficient stays exact, a big integer wherever a and b are whole numbers, rather than a floating point approximation. The middle coefficient of (x + 1)^100 is 100,891,344,545,564,193,334,812,497,256, all thirty digits of it, and a calculator working in doubles loses the tail of a number that size. Where the printed expansion would run past 20,000 characters the page says so and points at the single term, which is computed directly and stays exact.
Can it expand (x + y)^n, or a bracket with a squared term in it?
This calculator accepts (ax + b)^n with one variable and a linear bracket. It does not expand two-variable binomials or brackets containing a squared variable term, although the binomial theorem also applies beyond this calculator's input format. Use a single letter consistently: x and X are different variables. You can write 2*x, 3 + 2x, x/2 and 0.5x, and the expression pane shows the normalized bracket.
Does anything I type here leave my browser?
The calculator performs its arithmetic in your browser and does not send the expression to a calculation service. It stores the expression, mode and requested term in this browser so they can be restored on your next visit. With storage blocked, calculation still works but the draft is not remembered.
How do I find the middle term or the two middle terms?
Choose One term, then use Middle term for an even exponent, or First middle term and Second middle term for an odd exponent. Positions follow the n + 1 terms of the binomial formula, counting from the highest power and including positions whose coefficient is zero. For an even n, the middle position is n/2 + 1. For an odd n, the two positions are (n + 1)/2 and (n + 3)/2. Each button calculates that term and its coefficient directly.
What is the general rth term, and how do I select the fifth or eighth term?
For (ax + b)^n, term r is C(n, r - 1) times (ax)^(n - r + 1) times b^(r - 1), with r running from 1 to n + 1. Choose One term, then Term number, and enter 5 for the fifth term or 8 for the eighth. The result shows both the term number and k = r - 1. If the requested position is beyond n + 1, the page reports that it does not exist.
How do I find the constant term or the first three terms?
The constant term is b^n and appears in the Constant readout for Whole expansion. To show its coefficient and working alone, choose One term, then Power of x, and enter 0. For the first three binomial positions, use Whole expansion and read the coefficient-table rows k = 0, 1 and 2 when n is at least 2. These positions run from the highest power downward; a position with a zero coefficient remains in the table.
Are fractional coefficients the same as fractional powers?
No. Fractional coefficients such as x/2 and 1/3 are supported and kept exact. The exponent after the bracket must be a whole number from 0 to 100. Fractional-power and negative-power series are not supported, so this calculator does not cover those generalizations or every A level binomial-expansion exercise.

Exact expansion of (ax + b)^n: binomial coefficients are computed as big integers and a and b are kept as exact fractions, so whole inputs give whole coefficients and nothing is rounded anywhere in the chain, at any exponent up to 100. A single requested term is computed directly from C(n, k) rather than by expanding everything and reading one line off, so it is still exact where the whole expansion would be too long to print. An exponent of 0 returns 1 by the empty product convention, and the page states that beside the answer.