Binomial expansion

**Binomial expansion** is a method in algebra that changes a power of a binomial into a larger polynomial. Binomial expansion removes parentheses from an expression, which can help solve algebraic equations.

## Formula 
The simplest non-trivial case of binomial expansion is the case where a binomial is being squared.
(a+b)^2 = a^2 + 2 ab + b^2
This follows from the ditsributive and commutative properties of multiplication:
(a+b)^2 = a(a+b) + b(a+b) = aa + ab + ba + bb = a^2 + 2ab + b^2

For other exponents, the general formula is reached the same way. By applying the distributive property, we get a long sum of 2^{n} terms, each of which has a degree of n. This is similar to the aa + ab + ba + bb step for the square case. Using the commutative property, some of these terms are the same, so we can add them together.

Each term needs to have a total of  values. Call the number of s ; the number of s then has to be n-k. We can combine all these terms into a single one where the variables are a^{k}b^{n-k}. The coefficient of this term is all the number of ways you can have a word of length  with  s when the rest are s.

This problem is equivalent to "How many different ways can we choose  positions to be , out of  possible positions?" Mathematicians call this a combinations problem, and can be solved in terms of factorials. The number of combinations is written with the notation
\binom{n}{k} = \frac{n!}{k!(n-k)!}
The term with parentheses is read as " choose ". Because of its role in binomial expansion, this is also called the binomial coefficient of  and .

The formula for a general binomial expansion, where the binomial has two variables  and  and is raised to a power , is then given as:
(a+b)^{n} = \sum_{k=0}^{n} \binom{n}{k} a^{k}b^{n-k}

## Relation to Pascal's triangle 
s of the matching degree (the first row is row 0).]]

Pascal's triangle is a mathematical construction that represents binomial coefficients. It starts with a row of one element,
\binom{0}{0} = 1
The rest of the triangle is given by adding a new row, one unit larger than the previous, below it. The numbers in that row are the sum of the two numbers above it, with anything outside the triangle being treated as 0.

Pascal's triangle shows a recurrence relation on binomial coefficients:
\begin{array}{rl}
\binom{n}{0}  ={}& 1\\
\binom{n}{n} ={}& 1\\
\binom{n+1}{k} ={}& \binom{n}{k-1} + \binom{n}{k}\end{array}

In other words, the binomial coefficient of  and  can be found by adding the binomial coefficient of n-1 and k-1 to the binomial coefficient of n-1 and . In terms of terms in the binomial expansion, this says that every term with  s has to either have come from adding an  to a shorter term with k-1 s, or adding a  to a shorter term with  s.

### Examples 
:(5+3x)^3 = 1 \cdot 5^3 \cdot (3x)^0 + 3 \cdot 5^2 \cdot (3x)^1 + 3 \cdot 5^1 \cdot (3x)^2 + 1 \cdot 5^0 \cdot (3x)^3
:= 125 + 75 \cdot 3x + 15 \cdot 9x^2 + 1 \cdot 27x^3 = 125 + 225x + 135x^2 + 27x^3

:(5-3x)^3 = 1 \cdot 5^3 \cdot (-3x)^0 + 3 \cdot 5^2 \cdot (-3x)^1 + 3 \cdot 5^1 \cdot (-3x)^2 + 1 \cdot 5^0 \cdot (-3x)^3
:= 125 + 75 \cdot (-3x) + 15 \cdot 9x^2 + 1 \cdot (-27x^3) = 125 - 223x + 135x^2 - 27x^3

:(7+4x^2)^5 = 1 \cdot 7^5 \cdot (4x^2)^0 + 5 \cdot 7^4 \cdot (4x^2)^1 + 10 \cdot 7^3 \cdot (4x^2)^2 + 10 \cdot 7^2 \cdot (4x^2)^3 + 5 \cdot 7^1 \cdot (4x^2)^4 + 1 \cdot 7^0 \cdot (4x^2)^5
:= 16807 + 12005 \cdot 4x^2 + 3430 \cdot 16x^4 + 490 \cdot 64x^6 + 35 \cdot 256x^8 + 1 \cdot 1024x^{10}
:\, = 16807 + 48020x^2 + 54880x^4 + 31360x^6 + 8960x^8 + 1024x^{10}