<s>[INST] Integral of $(\log x)^3$ (Spivak's Calculus, Chapter 19, Problem 3v) 
$$\int (\log x)^3\,dx$$

I solved the problem by applying integration by parts twice:
First, I write the integrand as $(\log x)^2\cdot\log x$, and then I set $u=(\log x)^2 \Rightarrow du=\frac{2\log x}{x}dx$ and $dv=\log x\,dx \Rightarrow v=x\log x-x$:
$$\begin{align}\int (\log x)^2\cdot\log x\,dx&=x(\log x)^3-x(\log x)^2-\left(\int \frac{2\log x}{x}(x\log x-x)\,dx\right)\\&=x(\log x)^3-x(\log x)^2-\left(\int 2(\log x)^2\,dx-\int 2\log x\,dx\right)\\&=x(\log x)^3-x(\log x)^2-2\int (\log x)^2\,dx+\underbrace{\int 2\log x\,dx}_{=\,2x\log x-2x} \end{align}$$
Now, the integral of $(\log x)^2$ needs to be solved by integration by parts. I set $u=\log x\Rightarrow du=\frac{dx}{x}$ and $dv=\log x\,dx\Rightarrow v=x\log x-x$:
$$\begin{align}\int (\log x)^2\,dx&=x(\log x)^2-x\log x-\left(\int \frac{x\log x-x}{x}\,dx\right)\\&=x(\log x)^2-x\log x-\left(\int \log x\,dx-\int dx\right)\\&=x(\log x)^2-x\log x-(x\log x-2x)\\&=x(\log x)^2-2x\log x+2x\end{align}$$
Substituting the result of $\int (\log x)^2\,dx$ into the solution:
$$\begin{align}\int (\log x)^2\cdot\log x\,dx&=x(\log x)^3-x(\log x)^2-2(\overbrace{x(\log x)^2-2x\log x+2x}^{\,=\int\,(\log x)^2dx})+2x\log x-2x\\&=x(\log x)^3-x(\log x)^2-2x(\log x)^2+4x\log x-4x+2x\log x-2x\\&=x(\log x)^3-3x(\log x)^2+6x\log x-6x\end{align}$$
Therefore $$\int (\log x)^3\,dx=x(\log x)^3-3x(\log x)^2+6x\log x-6x$$
(I omitted the annoying $+C$ in my calculations)
My question is: Is there any more elegant and quicker solution?
 [/INST] Let $x = e^y$, $dx = e^y \, dy$, giving $$\int (\log x)^3 \, dx = \int y^3 e^y \, dy.$$  Now use tabular integration:  $$\begin{array}{|cc|c|} \hline y^3 & e^y & + \\ 3y^2 & e^y & - \\ 6y & e^y & + \\ 6 & e^y & - \\ \hline \end{array}$$ to obtain $$\int y^3 e^y \, dy = y^3 e^y - 3y^2 e^y + 6y e^y - 6 e^y + C.$$  Substituting back for $x$ gives the desired result.

Another example of tabular integration:  compute $$\int (x^4 + x^2) e^{-3x} \, dx.$$  We write $$\begin{array}{|cc|c|} \hline x^4 + x^2 & -\frac{1}{3}e^{-3x} & + \\ 4x^3 + 2x & \frac{1}{9} e^{-3x} & - \\ 12x^2 + 2 & -\frac{1}{27} e^{-3x} & + \\ 24x & \frac{1}{81} e^{-3x} & - \\ 24 & -\frac{1}{243} e^{-3x} & + \\ \hline \end{array}$$ to get $$\begin{align*} \int (x^4 + x^2) e^{-3x} \, dx &= -\frac{1}{3}(x^4 + x^2)e^{-3x} - \frac{1}{9}(4x^3 + 2x)e^{-3x} - \frac{1}{27}(12x^2 + 2)e^{-3x} \\ &\quad - \frac{1}{81}(24x)e^{-3x} - \frac{24}{243}e^{-3x} + C \\ &= -\frac{e^{-3x}}{81} (27x^4 + 36x^3 + 63x^2 + 42x + 14) + C. \end{align*}$$
</s>