Finding $n^{th}$ derivative of $x^2\log x$ 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:

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!
 A: 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!
A: Though @MitchellSpector gave the solution, here is how it (laboriously) works with Leibnitz:
$$(uv)^{(n)}=\sum_{k=0}^n\binom nku^{(n-k)}v^{(k)}.$$
Then
$$u=\ln x,u'=x^{-1},u''=-x^{-2},u'''=2!x^{-3},\cdots u^{(n)}=(-1)^{n-1}(n-1)!x^{-n},$$
$$v=x^2,v'=2x,v''=2,v'''=0,\cdots v^{(n)}=0,$$
and for $n\ge3$, the sum reduces to three terms
$$\binom n0u^{(n)}v+\binom n1u^{(n-1)}v'+\binom n2u^{(n-2)}v''\\
=(-1)^{n-1}(n-1)!x^{-n}\cdot x^2+n(-1)^{n-2}(n-2)!x^{1-n}\cdot 2x+\frac{n(n-1)}2(-1)^{n-3}(n-3)!x^{2-n}\cdot2\\
=((n-1)(n-2)-2n(n-2)+n(n-1)))(-1)^{n-3}(n-3)!x^{2-n}\\
=2(-1)^{n-3}(n-3)!x^{2-n}.$$

Note that the formula doesn't work for $n=2$ even though the Leibnitz development has the three terms. The reason is that 
$$u^{(n-2)}=(-1)^{n-3}(n-3)!x^{2-n}$$ doesn't hold for $n=2$.
A: we have $$f^{(iv)}(x)=2\cdot 2x^{-3}$$ and $$f^{(v)}=-2\cdot 2\cdot3x^{-4}$$
can you proceed?
