How to expand $(1+x+b)^2$ correctly? I'm trying to expand this trinomial equation and wish for your support on my solution.
I'm trying to prove: given $y = (1+x)^n$, then $\frac{dy}{dx}=n(1+x)^{n-1}$
By starting likeso: $(1+x+\nabla x)^n$ then expanding and cancelling when taking the derivative $\frac{\nabla dy}{\nabla dx}$
Although, to do this I need to know how to do trinomial expansions. Here is my effort with an example:
$(1+x+b)^2=[1+2x^{2-1}+\frac{2(2-1)}{2!}x^2] + [1+2b^{2-1}+\frac{2(2-1)}{2!}b^2]+[x+2b^{2-1}x+b^2]$.
I tried following a similar procedure as if it were determinant expansion (i.e. (1+x), (1+b), (x+b)), although I'm sceptical as to whether this is true.
The purpose was to figure this out, then perform the same expansion with $(1+x+\nabla x)^n$ to derive the derivative, otherwise if this way is not possible an alternative suggestion is helpful.
 A: A simple, straightforward way to expand a trinomial is to think of it as a "nested" binomial:
$$\begin{align}
(1+x+b)^2&=((1+x)+b)^2\\
&=(1+x)^2+2(1+x)b+b^2\\
&=1+2x+x^2+2b+2xb+b^2
\end{align}$$
after which you can regroup terms however you like or need. For the purpose of taking derivatives, it might best to leave things at the $(1+x)^2+2(1+x)b+b^2$ stage though, since that gives
$${(1+x+b)^2-(1+x)^2\over b}={(1+x)^2+2(1+x)b+b^2-(1+x)^2\over b}=2(1+x)+b$$
Can you see from this how to approach the more general problem of differentiating $y=(1+x)^n$?
Additional remark: I'm not sure what's behind your expansion of $(1+x+b)^2$, but the result is wrong. Simplifying the right hand side gives
$$[1+2x+x^2]+[1+2b+b^2]+[x+2bx+b^2]=2+3x+x^2+2b+2bx+2b^2$$
which is not correct. If you don't see what you did wrong in getting the expansion you did, that might be worth a separate question.
A: Barry Cipra's answer already gives a great explanation, but I want to provide a slightly different way of expanding brackets which I find to be slightly more elegant, and which will allow you to generalise to $(1+x)^n$ more easily.
In general, suppose you want to expand brackets of the general form $(a_0+a_1+...+a_m)(b_0+b_1+...+b_n)(c_0+c_1+...+c_p)$. The way to get the result is just to multiply together every combination of numbers $a_i \times b_j \times c_k$, and then sum the results. So your result will look something like $a_0 b_0 c_0 + a_0 b_0 c_1 + ... + a_0 b_0 c_p + a_0 b_1 c_0 + ... + a_m b_n c_p$
To understand why, imagine you know the sum of the terms of your first bracket to be $a$, and the sum of terms in your second bracket to be $b$. Then your equation can be simplified to $ab(c_0+c_1+...+c_p)$. From there you probably already remember from algebra that the way to expand out the bracket is to multiply $ab$ with every term of the remaining bracket, so you'll end up with a series of terms $abc_0+abc_1+...+abc_p$. We'll look at $abc_0$ from now on, but the same argument will hold for every term. You can then 'remember' the definition of $b$ again, and you'll see $abc_0 = ac_0(b_0+b_1+...+b_n)$. But from there, you can simply repeat exactly the same process, and you'll get a series of terms $ab_0c_0+ab_1c_0+...+ab_nc_0$. You can also repeat the steps for $a$ to get the full equation.

At the risk of being more confusing than helpful, there are a couple simplifications you can make to make your life easier. The first is a substitution. You can let $u=1+x$, take the derivative of $u$, and undo the substitution on the other side. This turns out to be a much less hairy equation to deal with, though you'll eventually get the same answer out the other side through either route.
The second is to notice that if your $dx$ is meant to be a small number, almost 0, then $dx^2$ or any higher power is going to be tiny. So tiny, in fact, that you can safely ignore those terms and pretend they're equal to 0. That means, instead of needing to expand all of your brackets in the above equation, and then collect like terms, which is just a nightmare, you can instead say "Does this result give me multiple powers of $dx$?" - If the answer's yes, ignore it.
