# Integral of xln(x)

In this post I am going to explain step-by-step how to integrate the function xln(x). We can solve it by using integration by parts (click here if you want to know more about it), and as you will see something interesting will happen!

$\int&space;x\ln(x)\,dx$

Let’s let u=x, so that du=dx. If we let u=ln(x), it means that dv=xdu and so v=x²/2, and we don’t want the degree of the x to increase. To find v, we need to integrate dv, and as we saw here, the integral of ln(x) is x(ln(x)-1); therefore:

$u=x\,\,\,\,\,\,dv=\ln(x)dx$ $du=dx\,\,\,\,\,\,v=x(\ln(x)-1)$

Now we can multiply u and v cross-wise and v and du horizontally:

$x^2(\ln(x)-1)-\int&space;x(\ln(x)-1)\,dx$

Let’s apply linearity:

$x^2(\ln(x)-1)-\int&space;x\ln(x)\,dx+\int&space;x\,dx$ $x^2(\ln(x)-1)-{\color{Red}&space;\int&space;x\ln(x)\,dx}+\frac{1}{2}x^2$

At this point you can notice that we have the integral we had at the beginning; this means

$\int&space;x\ln(x)\,dx=x^2(\ln(x)-1)-\int&space;x\ln(x)\,dx+\frac{1}{2}x^2$

We can move the integral on the right-hand side to the left and treat everything like an equation:

$\int&space;x\ln(x)\,dx+\int&space;x\ln(x)\,dx=x^2(\ln(x)-1)+\frac{1}{2}x^2$ $2\int&space;x\ln(x)\,dx=x^2(\ln(x)-1)+\frac{1}{2}x^2$ $\int&space;x\ln(x)\,dx=\frac{1}{2}x^2(\ln(x)-1)+\frac{1}{4}x^2$ $\int&space;x\ln(x)\,dx=\frac{1}{2}x^2\left&space;(&space;\ln(x)-\frac{1}{2}&space;\right&space;)+C$

And this is the solution to the integral!