Binomial Expansion Calculator
Type a bracket and a power, such as (2x + 3)^12, and the page writes the expansion out the way the binomial theorem builds it: one line per value of k, carrying C(n, k), the power of 2x and the power of 3 that made that term, and then the finished polynomial underneath. The other half of this search is one term rather than all of them, so a second mode takes the power of x you want, or the position counting from the first term, and computes that coefficient straight from C(n, k) without expanding anything else. Coefficients are exact big integers and exact fractions, never decimals, so the middle coefficient of a hundredth power keeps all of its digits and a bracket written with halves and thirds stays in halves and thirds. Exponents run from 0 to 100, and the bracket has to be linear, because that is exactly what the binomial theorem covers.
(2x + 3)^3 a = 2 b = 3 n = 3 C(3,k) 1 3 3 1
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- Terms
- Exponent
- Leading
- Constant
Degree 3, 4 terms: each coefficient is C(3,k) times 2^(3-k) times 3^k, with k running from 0 to 3.
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.
| k | C(3,k) | power of ax | power of b | term |
|---|---|---|---|---|
| 0 | 1 | (2x)^3 | 1 | 8x³ |
| 1 | 3 | (2x)^2 | (3) | 36x² |
| 2 | 3 | (2x) | (3)^2 | 54x |
| 3 | 1 | 1 | (3)^3 | 27 |
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, because that is what the binomial theorem covers: a squared term inside it is refused by name rather than guessed at. 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 bracket with two terms, (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. The bracket appears zero times, and an empty product is 1 by the convention every textbook uses, so (2x + 3)^0 is 1 and the expansion has a single term. The page says which convention it is following beside the answer rather than leaving you to guess, and it holds 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?
- No, and it says so rather than guessing. This page expands (ax + b)^n, where the bracket is linear and has one variable, which is exactly what the binomial theorem covers. A second letter, a squared term or two brackets multiplied together are each refused by name so you know what was read and what was not. Inside the bracket you can still write 2*x, 3 + 2x, x/2 and 0.5x, and the page shows what it understood at the top of the stage.
- Does anything I type here leave my browser?
- No. The arithmetic runs in the page, there is no account and nothing is sent anywhere. The expression, the mode and the term you asked for are remembered in this browser so the page opens where you left it, and the Start over button at the top of the page forgets them. With storage blocked the tool still works, it simply does not remember.
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.