[Math] Finding $n^{th}$ derivative of $x^2\log x$

calculusderivatives

I need to find the nth derivative of $x^2 \log x$ and to do that I tried just differentiating the function with the hope of finding a pattern. So I did the following:
$f'(x) = 2x\log x + x$
$f''(x) = 2\log x + 3$
$f'''(x) = 2/x$
$f''''(x) = -2/x^2$

and, unfortunately, I could not spot any pattern. I also thought of applying Leibniz's theorem:

enter image description here

but I am not sure how I could simplify the expression when subbing $\log x$ as $u$ and $x^2$ as $v$.

Could anyone advise if there is another method of solving this problem?

Thank you!

Best Answer

I think the OP's question may really have been how to incorporate all the $f^{(n)}\text{'s}$ into a single formula, since $f, f',$ and $f''$ don't seem to follow the same pattern as the later ones.

Usually the answer would simply be written in cases, like

$$f^{(n)}(x)=\begin{cases}x^2 \log x,&\text{if }n=0, \\2x \log x+x, &\text{if }n=1, \\2\log x +3, &\text{if }n=2, \\2(-1)^{n+1}(n-3)!x^{2-n},&\text{if }n\ge 3, \end{cases}$$

without trying to come up with some artificial formula that covers $n=0, 1,$ and $2$ also.


If you really want to try to merge these, the best way would be to write

$$f^{(n)}(x)=\begin{cases} \frac{x^{2-n}}{(2-n)!}(2 \log x - 2 H_{2-n}+3),&\text{if }n\le 2, \\2(-1)^{n+1}(n-3)!x^{2-n},&\text{if }n\ge 3, \end{cases}$$

where $\,H_n=\sum_{k=1}^n \frac1{k}\,$ is the $\,n^{\text{th}}$ harmonic number, because then the formula even works for negative integer values of $n,$ with $\,f^{(-n)}(x)\,$ being an $n^{\text{th}}$ antiderivative of $\,f(x).$ (This still has two cases though, and I don't see a natural way to merge them into one.)

But if this was a homework problem, as I assume it was, this complicated formula isn't what was intended. And if you really only need the derivatives, it's overkill!