Why is $(x+h)^n$ written like this? I encountered this in my calculus book:
$$f\;'(x)= \lim_{h \to 0} \frac{f(x+h)-f(x)}{h}$$
$$f(x)=x^n$$
$$\begin{align*}
(x + h)^n &= (x + h)(x + h)...(x + h)\\
&=x^n + nhx^{n-1}+ \text{stuff  involving }h^2\text{ as factor}
\end{align*}$$
I don't get where that $nhx^{n-1}$ and stuff involving $h^2$ as factor come from. A little help please?
 A: The binomial theorem gives another answer here :
$$(x+h)^n = \sum_{k=0}^n \binom{n}{k} x^k h^{n-k}$$
By expanding the first terms, we obtain $$(x+h)^n = x^n + \binom{n}{1}hx^{n-1} + \binom{n}{2} x^{n-2} h^{2}+\cdots$$
In all the terms in the dots, the power of $h$ is greater than 2, so you can factorize by $h^2$. Moreover $\binom{n}{1} =n$  :
 $$(x+h)^n = x^n + n h x^{n-1} + h^2 \times ( \cdots ) $$
A: Let us consider what happens when we try to expand $$ (x+h)^n = (x+h)(x+h)\cdots (x+h) .$$
To expand the RHS, we must pick either $x$ or $h$ from each bracket, and multiply them together to produce a term. The full expansion consists of the sum of the terms produced over all combinations of us picking $x$ or $h$ from each bracket. 
What if we pick no $h$'s from any of the brackets? Then we pick $x$ every time, and the term produced is $x^{n}.$ 
Now, what if we pick $h$ exactly from the 1-st bracket? Then we must pick $x$ from the other $n-1$ brackets, so the term produced is $hx^{n-1}.$ Now if we pick $h$ exactly once, but from the 2nd bracket, same term is produced. We can pick our single $h$ from any of the $n$ brackets, so that means all the terms produced by picking exactly one $h$ sum to $nhx^{n-1}.$ 
Now, we've considered what happens if we pick 0 $h$'s (we get $x^n$) and 1 $h$ (we get $nhx^{n-1}$. Everything else must involve picking $h$ at least twice, and if we pick $h$ twice the term produced has at least a factor of $h^2$ in it, explaining the "stuff involving $h^2$ as a factor" term. 
