The $n$-th derivative of $x^2(x+1)^n$?

I need to find the derivative of $x^2(x+1)^n$.

I need to use Leibniz formula but I just can't get the result. We are supposed to get this : Correct Result

But I got nearly the same kind : $$x^2n! + 2xn!(x+1) + 2\frac{n!}{2!}(x+1)^2$$ $$= n!(x^2 + 2x(x+1) + (x+1)^2 $$ My Work It starts from the mess below the horizontal line. So I don't know how to get the result. I really can't understand what I did wrong. I succeeded in similar questions like nth derivative of $(x-a)^n(x-b)^n$. I would really appreciate it if someone could lend a hand. Thank you in advance!


Solution 1:

It's really difficult to read your writing; for me to try to detect where you might have made a calculation error would probably take longer than to just write my own step-by-step solution.

Let $f(x) = x^2$, $g(x) = (x+1)^n$, and $h(x) = f(x)g(x) = x^2 (x+1)^n$. Then we want $$h^{(n)}(x) = (fg)^{(n)} = \sum_{k=0}^n \binom{n}{k} f^{(k)}(x) g^{(n-k)}(x). \tag{1}$$

As you observed, $f^{(k)}(x) = 0$ for all $k > 2$, so the sum on the RHS in Equation $(1)$ only contains $3$ terms. These require the evaluation of $g^{(n-k)}(x)$ for $k \in \{0, 1, 2\}$. To this end, we observe $$\begin{align} g'(x) &= n(x+1)^{n-1} , \\ g''(x) &= n(n-1)(x+1)^{n-2} , \\ &\vdots \\ g^{(m)}(x) &= n(n-1)\cdots(n-m+1)(x+1)^{n-m} = \frac{n!}{(n-m)!} (x+1)^{n-m}, \quad m \in \{1, \ldots, n\}. \tag{2} \end{align}$$ So now letting $m \in \{n-2, n-1, n\}$ in Equation $(2)$ gives in particular $$\begin{align} g^{(n-2)}(x) &= \frac{n!}{2!} (x+1)^2 = \frac{n!}{2} (x+1)^2, \\ g^{(n-1)}(x) &= \frac{n!}{1!} (x+1)^1 = n! (x+1), \\ g^{(n)}(x) &= \frac{n!}{0!} (x+1)^0 = n!. \end{align}$$ It follows that $$\begin{align} h^{(n)}(x) &= \binom{n}{0} f(x) g^{(n)}(x) + \binom{n}{1} f'(x) g^{(n-1)}(x) + \binom{n}{2} f''(x) g^{(n-2)}(x) \\ &= (x^2) n! + n (2x) n!(x+1) + \frac{n(n-1)}{2} (2) \frac{n!}{2}(x+1)^2 \\ &= n! \left( x^2 + 2nx(x+1) + \frac{n(n-1)}{2}(x+1)^2 \right). \end{align}$$


Upon examination of your handwritten notes, I think I have found your error. You wrote $$h^{(n)}(x) = \binom{\color{red}{2}}{0} f(x) g^{(n)}(x) + \binom{\color{red}{2}}{1} f'(x) g^{(n-1)}(x) + \binom{\color{red}{2}}{2} f''(x) g^{(n-2)}(x)$$ where the red text is incorrect; the upper index of the binomial coefficients must be $n$, not $2$, even though there are only three terms in the sum.

Solution 2:

A small amount of cleverness makes this much more tractable, and avoids combinatorics:

Namely, the leading factor of $x^2$ is $(x+1)^2-2(x+1)+1$. So the whole expression can be expressed in powers of $x+1$, as $$ \Big((x+1)^2-2(x+1)+1\Big)\cdot (x+1)^n \;=\; (x+1)^{n+2} - 2(x+1)^{n+1} + (x+1)^n $$ Thus, the derivative is $$ (n+1)(x+1)^{n+1} - 2(n+1)(x+1)^n + n(x+1)^{n-1} $$ Rearrange to taste. :)