# Integration by parts of $x\ln (x)$ is giving me the wrong answer?

$\newcommand{\d}[1]{\mathop{\mathrm d #1}}$ To integrate $x\ln (x)$, let $u = x$ and $\d v = \ln(x)\d x$. It becomes

$$\int x\ln(x)\d x = x\int \ln(x)\d x\,-\int \int \ln(x) \d {x^2}$$

simplified to

$$\int x\ln(x)\d x = x(x\ln(x) -x)\,-\int(x\ln(x) - x)\d x$$

break up integral and solve integral $x \d x$

$$\int x\ln(x)\d x = x(x\ln(x) -x)\,-\int x\ln(x) \d x - \frac{1}{2}x^2 \qquad(\star)$$

add (integral $x \ln x \d x$) to both sides then divide by two

$$\int x\ln(x)dx = \frac{x(x\ln(x) -x) - \frac{1}{2}x^2}{2}$$

$$\frac{1}{4}x^2(-1+2\log (x))$$

which is not the same function.

What am I doing wrong?

I can do this problem fine if I assign $u$ and $v$ the other way around, but this should still work and I feel like I'm making a dumb mistake somewhere.

• Hint: take $dv = 1$ and $u = x\ln x$. It's a lot easier. Oct 2, 2016 at 7:43
• You dropped a minus in the step from $\int x\ln x -x\mathrm{d}x=\int x\ln x \mathrm{d}x-x^2/2$
– Jam
Oct 2, 2016 at 7:43
• $\uparrow$ marked with a star Oct 2, 2016 at 7:45

$$\begin{cases} du=xdx \\ v=\ln { x } \end{cases}\Rightarrow \begin{cases} u=\frac { { x }^{ 2 } }{ 2 } \\ dv=\frac { dx }{ x } \end{cases}\\ \int { x\ln { xdx } } =\frac { { x }^{ 2 }\ln { x } }{ 2 } -\int { \frac { x }{ 2 } dx= } \frac { { x }^{ 2 }\ln { x } }{ 2 } -\frac { { x }^{ 2 } }{ 4 } +C$$
\begin{align}∫x\ln x \,\mathrm{d}x&=x(x\ln x−x)−∫(x\ln x−x)\,\mathrm{d}x \\&=x(x\ln x−x)+∫(-x\ln x+x)\,\mathrm{d}x \\&=x(x\ln x−x)+∫(-x\ln x)\,\mathrm{d}x+\frac{1}{2}x^2 \end{align}
Here is just a different approach. Not necessarily better, just different: Why not u-sub $lnx=t$ so that $dx=e^tdt$. The integral becomes then $\int{te^{2t}dt}$. This can be done MUCH easier now with integration by parts. You can even go one step further: Set $2t=v$ and then $dt=0.5dv$. Then the integral becomes $\frac{1}{4}\int{ve^vdv}$. Why would you do that? Because now the original integral has been completely reduced to a Standard integral. Of course, this is also done through integration by parts but more basic than this is not possible. Problems like $\int{xe^xdx}$ can be found in any standard Calculus book. All you need to do is back subs, which is standard algebra. I am a big proponent for transforming given integrals in terms of standard integrals because the work becomes so much easier and if you have once set up a list of standard integrals, you don't have to integrate over and over again...