Binomial Expansion Calculator

Use this calculator to expand expressions of the form (ax + by)n with the binomial theorem. Enter numeric coefficients a and b and a non-negative integer exponent n to generate the expanded polynomial and a term-by-term table that shows how each row is built.

How this binomial expansion calculator works

Introduction to the binomial expansion

A binomial is a sum of two terms, such as (x + y), (x − y), or the more general form used here, (ax + by). When you raise a binomial to a whole-number power, the result is a polynomial with a very regular structure. The powers of x step downward one at a time, the powers of y step upward one at a time, and the numeric multipliers follow a combinatorial pattern. The binomial theorem lets you compute that pattern directly instead of multiplying the binomial by itself over and over.

This calculator expands (ax + by)n where a and b are real numbers, including decimals, and n is a non-negative integer. The output includes a readable expanded expression and a table listing every term index k, the resulting coefficient, and the variable part for that term. Because the calculation runs entirely in your browser, you can try examples quickly without sending anything to a server.

In many courses the topic first appears with small cases such as (x + y)2 or (x + y)3. The same theorem, however, also handles higher powers, non-unit coefficients, and negative coefficients. That is why a tool like this is useful for checking sign changes, comparing patterns from Pascal’s triangle, and seeing how the coefficient and exponent rules interact in one place.

How to use this binomial expansion calculator

  1. Enter Coefficient a, the multiplier on x.
  2. Enter Coefficient b, the multiplier on y.
  3. Enter Exponent n as a whole number: 0, 1, 2, 3, and so on.
  4. Select Expand (ax + by)n.
  5. Read the expanded expression and the term table. Use Copy terms if you want the results on your clipboard.

If you want the standard classroom form (x + y)n, set a = 1 and b = 1. If you want (2x − 3y)n, enter a = 2 and b = −3. Decimal coefficients are also allowed, so examples such as (0.5x + 1.25y)n work as well.

A quick self-check helps when you are learning. When n = 0, the expansion should be 1. When n = 1, the output should match the original binomial ax + by. Those edge cases are simple, but they reveal whether your setup makes sense before you move on to larger exponents.

Formula and binomial theorem

The binomial theorem states that for a non-negative integer n:

Formula: (a+b)^n = ∑ k = 0 n (n / k) a^n−k b^k

(a+b)n=k=0n(nk)ankbk

For this calculator, substitute a → ax and b → by. Each term in the expansion becomes:

Formula: (n / k) a^n−k b^k x^n−k y^k

(nk)ankbkxnkyk

The factor (n choose k) is the binomial coefficient. It also appears in Pascal’s triangle, and it counts the number of ways to choose k copies of the by term from the n factors in a product such as (ax + by)(ax + by)…. That counting interpretation is the reason the algebraic pattern is so reliable.

One especially useful symmetry is (n choose k) = (n choose n − k). That symmetry explains why Pascal’s triangle reads the same from left to right and right to left. Even when a and b are not equal, the term positions still follow that mirrored combinatorial structure.

Worked example for (2x + 3y)^4

Example: expand (2x + 3y)4. Here a = 2, b = 3, and n = 4. The calculator evaluates each term for k = 0 through k = 4.

  • k = 0: (4 choose 0) · 24 · 30 · x4 · y0 = 16x4
  • k = 1: (4 choose 1) · 23 · 31 · x3 · y = 96x3y
  • k = 2: (4 choose 2) · 22 · 32 · x2 · y2 = 216x2y2
  • k = 3: (4 choose 3) · 21 · 33 · x · y3 = 216xy3
  • k = 4: (4 choose 4) · 20 · 34 · y4 = 81y4

So the expansion is 16x^4 + 96x^3y + 216x^2y^2 + 216xy^3 + 81y^4. If you repeat the same example with a negative coefficient, such as (2x − 3y)4, the odd powers of b produce negative terms and the even powers produce positive terms. That alternating sign pattern is exactly the kind of detail this calculator helps you verify.

A second self-check is substitution. If you set x = 1 and y = 1, then the original expression becomes (2 + 3)4 = 625. If the expansion is correct, the expanded polynomial should also evaluate to 625 at those same values.

Interpreting the binomial expansion output

After you submit the form, the calculator shows a result summary, a term table, and the full expression. The table is useful when you want to inspect the expansion step by step, while the single-line expression is more convenient if you want something easy to copy into notes or homework.

  • Term table: each row corresponds to one value of k. The coefficient combines (n choose k), an−k, and bk. The term column shows the matching powers of x and y.
  • Expanded expression: this joins all nonzero terms with the correct plus and minus signs, using caret notation such as x^4 for powers.

Terms whose computed coefficients are effectively zero are omitted from the display. That mainly matters when one of the numeric coefficients is zero. For example, if a = 0, every term involving x disappears and only the final y term survives. If b = 0, the opposite happens and only the first term remains.

Display formatting is rounded for readability. Very large values or very small nonzero values may appear in scientific notation. That does not change the underlying mathematics; it only keeps the result compact enough to read.

Pascal’s triangle reference

The first few rows of Pascal’s triangle give the binomial coefficients for expansions of (x + y)n. This calculator computes the coefficients directly, which is more flexible for general inputs, but the pattern is the same. If you are studying the theorem, try setting a = 1 and b = 1 and compare the calculator output to the rows below.

First six rows of Pascal’s triangle
n, k012345
01
111
2121
31331
414641
515101051

Two patterns are worth keeping in mind. First, the outer edges are always 1. Second, every interior number equals the sum of the two numbers above it. A related check is that the sum of the coefficients in row n is 2n. So if you expand (x + y)n and then substitute x = 1 and y = 1, the result should be 2n.

Assumptions and limitations for binomial expansion

  • Exponent must be a non-negative integer. Negative or fractional exponents require the generalized binomial theorem, which produces an infinite series and is outside the scope of this tool.
  • Numeric coefficients only. Inputs a and b are interpreted as numbers. Symbolic coefficients are not supported.
  • Rounding is for display only. Very large or very small numbers may appear in scientific notation so the result stays readable.
  • Large exponents can overflow. Extremely large values can exceed JavaScript’s safe numeric range even though the coefficient algorithm avoids direct factorials.
  • Variables are fixed as x and y. The output uses those variable names consistently.

Why the coefficients look the way they do

Each term comes from deciding where the by factor appears among n copies of (ax + by). Choosing it k times gives yk and leaves xn−k from the remaining factors. The number of different ways to make that choice is exactly (n choose k), which is why combinatorics and algebra meet so naturally here.

The calculator computes (n choose k) multiplicatively rather than by evaluating factorials directly. That keeps intermediate numbers smaller and is usually more reliable for the moderate exponents most students use in coursework. In plain language, it builds the coefficient step by step instead of calculating three large factorials and dividing them afterward.

Once you see that pattern, the rest of the expansion becomes easier to remember. The exponents move in opposite directions, the coefficients come from counting choices, and the sign behavior follows the sign of b raised to the power k. Those three ideas explain nearly every term in the table you see below the calculator.

FAQ and troubleshooting

Why does this binomial expansion calculator require a whole-number exponent?

The finite binomial theorem used on this page only applies when n is a whole number that is 0 or greater. If you enter a blank field, a fractional value, or a negative exponent, the calculator will stop and ask for a valid whole-number exponent.

Can I expand (ax − by)n with this calculator?

Yes. Enter a negative value for b. For example, to expand (x − y)5, set a = 1, b = −1, and n = 5. The signs in the resulting expression will alternate according to the odd and even powers of b.

What does k mean in the binomial term table?

The index k counts how many times the by term is chosen across the n factors. That is why the variable part is xn−kyk. When k = 0, the term has only x. When k = n, the term has only y.

How can I check a binomial expansion quickly?

Substitute simple values such as x = 1 and y = 1, then compare the original binomial and the expanded polynomial. The numbers should match. This is not a full proof that every coefficient is correct, but it catches many common setup errors.

Why are some coefficients shown in scientific notation?

Scientific notation is used when the number is very large or very small and a long decimal would be harder to read. The value has not changed; only the display format has changed.

Does this binomial expansion calculator simplify like terms?

A binomial expansion already produces distinct power combinations of x and y, so there are normally no like terms to combine. The calculator does, however, omit terms whose computed coefficients are essentially zero.

What are common classroom uses for binomial expansion?

Students use binomial expansion to practice algebraic manipulation, recognize coefficient patterns, connect algebra with counting, and support later work in probability and calculus. This page is designed to make those links visible by pairing a full expression with a term-by-term breakdown.

Binomial expansion inputs

This is the numeric multiplier on x in (ax + by).

This is the numeric multiplier on y in (ax + by).

Use whole numbers. Negative or fractional exponents require an infinite-series version of the binomial theorem, which this calculator does not compute.

Enter coefficients and exponent.

Optional mini-game: Pascal Pulse

If you want to turn the same binomial expansion pattern into a quick reflex-and-reasoning challenge, Pascal Pulse asks you to build expansions one correct term at a time. Each round shows a binomial such as (2x − 3y)4 and tells you which index k comes next. Several drifting term cards appear on the canvas. Your job is to tap or click the one card that really matches the binomial theorem at that moment. The right answer must have the correct sign, the correct coefficient, and the correct powers of x and y, so the game rewards understanding rather than random guessing.

Runs last about 75 seconds. The opening wave is calm so you can settle into the core pattern: the power of x falls from n toward 0 while the power of y rises from 0 toward n. Later waves speed up, add sign traps, and increase the number of decoys. If your calculator inputs already contain a small integer example, the first round uses that setup so the game feels connected to the algebra you were just exploring. It is completely optional and never changes the actual calculator result.

Score0
Time75.0s
Streak0
Progress0/0
Round0

Press start to begin a term-matching run.

Pascal Pulse

Spot the next correct term in the expansion before the timer runs down.

  • Objective: choose the drifting card that matches the current k term of the displayed binomial.
  • Controls: tap or click a card. Keyboard fallback: press 1 to 5 for the visible card slot numbers.
  • Scoring: fast correct answers build streaks. Wrong picks and slow decisions cost time.

Best score: 0

Game ready. Start whenever you want a short binomial-theorem drill.

Embed this calculator

Copy and paste the HTML below to add the Binomial Expansion Calculator for (ax + by)^n Terms to your website.