<s>[INST] Find the integral $\int _{1}^{e} (x \ln x)^2 dx$. 
Find : $$\int _{1}^{e} (x \ln x)^2 \;dx.$$

My answer:
I have tried integration by parts with $u = x^2$ and $dv = (\ln x)^2$ but I end up having the same integration another time!
I reversed the role of $u$ & $v$, but it also did not work?
Do you have any suggestions ? 
 [/INST] Let $u=(\ln x)^2$ and $dv=x^2 \,dx$. Then $du=2(\ln x)\frac{1}{x} \, dx$ and $v=\frac{x^3}{3}$. So
$$I=\int_1^e(x \ln x)^2 \, dx=(\ln x)^2 \frac{x^3}{3}\Big|_{1}^{e}-\frac{2}{3}\int_1^e x^2 \ln x \, dx.$$
Now we will solve the integral on the right side. Call the integral as $J$. For this $u=\ln x$ and $dv=x^2 \, dx$. So $du= \frac{1}{x}\,dx$ and $v=\frac{x^3}{3}$.Then
$$J=(\ln x) \frac{x^3}{3}\Big|_{1}^{e}-\frac{1}{3}\int_1^e x^ 2\, dx=(\ln x) \frac{x^3}{3}\Big|_{1}^{e}-\frac{x^3}{9}\Big|_{1}^{e}=\frac{e^3}{3}-\left(\frac{e^3-1}{9}\right)=\frac{2e^3+1}{9}.$$
So
$$I=\frac{e^3}{3}-\frac{2}{3}\left(\frac{2e^3+1}{9}\right)=\frac{5e^3-2}{27}$$
</s>