# Leibniz formula for the nth derivative of $f(x)=x^{n-1} \ln x$

Problem : Calculate the derivative of the function $$f: ]0,+\infty\left[\longrightarrow \mathbb{R}\right.$$ defined by $$f(x)=x^{n-1} \ln x$$.

Solution Let $$g_{1}(x)=x^{n-1}$$ et $$g_{2}(x)=\ln x .$$ So we have$$f=g_{1} g_{2}$$ for all $$k$$ verifying $$1 \leq k \leq n-1$$ we have $$g_{1}^{(k)}(x)=(n-1) \cdots(n-1-k+1) x^{n-1-k}$$ et $$g_{1}^{(n)}(x)=0$$ The Leibniz formula gives

$$\begin{array}{c} f^{(n)}(x)=\sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right) g_{1}^{(k)}(x) g_{2}^{(n-k)}(x) \\ =x^{n-1} \frac{(-1)^{n-1}(n-1) !}{x^{n}}+\sum_{k=1}^{n-1}\left(\begin{array}{l} n \\ k \end{array}\right)(n-1) \cdots(n-1-k+1) x^{n-1-k} \frac{(-1)^{n-k-1}(n-k-1) !}{x^{n-k}} \\ =\frac{(-1)^{n-1}(n-1) !}{x}+\sum_{k=1}^{n-1}\left(\begin{array}{l} n \\ k \end{array}\right) \frac{(-1)^{n-k-1}(n-1) !}{x}\\ =-\frac{(n-1) !}{x} \cdot \sum_{k=0}^{n-1}\left(\begin{array}{l} n \\ k \end{array}\right)(-1)^{n-k} \end{array}$$

The sum above is the same as $$\sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)(-1)^{n-k}$$ (prived of $$k=n,$$) which is equal to -1

We obtain $$f^{(n)}(x)=\frac{(n-1) !}{x}$$

What I don't get: What's the point of this step:

we have $$g_{1}^{(k)}(x)=(n-1) \cdots(n-1-k+1) x^{n-1-k}$$ et $$g_{1}^{(n)}(x)=0$$

and which solution is wrong?

I spent a lot of time already on this, I think it's a matter of indices I can't point, both solutions seem correct to me.

How I calculated :

we have that

$$\ln ^{(n)}(x)=\frac{(-1)^{n-1}(n-1) !}{x^{n}}$$

and

$$(x^{n-1})^{(k)} = \frac{(n-1) !x^{n-1-k}}{(n-1-k) ! }$$

\begin{aligned} f^{(n)} &=\sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)\left(x^{n-1}\right)^{(k)}(\ln x)^{(n-k)} \\ &=\sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right) \frac{(n-1) !x^{n-1-k}}{(n-1-k) ! } \frac{(n-1-k) !(-1)^{n-1-k}}{x^{n-k}} \\ =& x^{-1} \sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)(n-1) !(-1)^{n-k-1} \end{aligned}

$$= (-1)x^{-1} (n-1) ! \sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)(-1)^{n-k}$$

which should give me zero? since

$$\sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)(-1)^{n-k} = (1+(-1))^{n}=0$$

I know I'm not answering the question, but I can't resist the temptation to show you a trick to arrive at the solution faster (no Leibniz formula): Integrate once before differentiating.

Let $$f_n(x)=x^{n-1}\ln x$$. Compute one of its primitives (antiderivatives) by integrating by parts: $$\int_0^xf_n(t)dt=\frac{x^n}n \ln x-\frac{x^{n-1}}{n^2}=\frac{f_{n+1}(x)}n-\frac{x^{n-1}}{n^2}$$ So to obtain $$f_n^{(n)}(x)$$, we just need to differentiate the above $$n+1$$ times (noting that this will cancel the second term as it's a polynomial of degree $$n-1$$): $$f_n^{(n)}(x)=\frac{f_{n+1}^{(n+1)}(x)}n$$ Solving this recurrence formula gives you the result $$f_n^{(n)}(x)=(n-1)!f_1^\prime(x)=\frac{(n-1)!}{x}$$

Your solution is almost correct (and neither $$g_1^{(k)}(x)$$ or $$g_1^{(n)}(x)$$ are wrong). The only problem is that $$(x^{n-1})^{(k)} = \frac{(n-1) !x^{n-1-k}}{(n-1-k) ! }$$ is only true for $$0 \le k \le n-1$$. For $$k \ge n$$, the $$k$$th derivative will be $$0$$. For example, the $$2$$nd derivative of $$x^1$$ is $$0$$.

The step $$f^{(n)} =\sum_{k=0}^{n}\binom{n}{k}\left(x^{n-1}\right)^{(k)}(\ln x)^{(n-k)} \tag 1$$

is right. But then at the next step, the sum should only go from $$k = 0$$ to $$k = n-1$$ since $$\left(x^{n-1}\right)^{(n)} = 0$$.

Then after that, the same logic applies, so you would end up with $$= (-1)x^{-1} (n-1) ! \sum_{k=0}^{n-1}\binom{n}{k}(-1)^{n-k} = \frac{(n-1)!}{x}$$

• When you say, "But then at the next step, the sum should only go from $k = 0$ to $k = n-1$ since $\left(x^{n-1}\right)^{(n)} = 0$" how so, and why? Dec 16 '20 at 19:25
• @squareroot Maybe a better explanation would have been splitting it from $k = 0$ to $k = n-1$ and having a separate case for $k = n$. When $k = n$, the summand would be $0$ since $\left(x^{n-1}\right)^{(n)} = 0$, so the $k = n$ term can be "chopped off". Dec 16 '20 at 19:55
• How does not separating the $k=n$ makes the following wrong $(-1)x^{-1} (n-1) ! \sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)(-1)^{n-k} = (-1)x^{-1} (n-1) ! \sum_{k=0}^{n}\left(\begin{array}{l} n \\ k \end{array}\right)(-1)^{n-k} = (-1)x^{-1} (n-1) ! (1+(-1))^{n}=0$ Dec 19 '20 at 20:16
• @squareroot That's all right, but the steps taken to get to that first point are wrong. To start off, the sum should only be from $k = 0$ to $k = n-1$. Dec 19 '20 at 20:35
• why does the sum should only be from $k=0$ to $k=n-1$ just because the nth term is null? what in the steps is exactly wrong or doesn't suffice any necessary condition ? Dec 19 '20 at 20:39