Solution:
Key idea: When a logarithm stands alone, integrate by parts with 1 as the second function: ∫u⋅1dx=ux−∫xu′dx. Here this is done twice, because (logx)2 first reduces to logx. As usual, log means the natural logarithm and x>0.
Step 1 — First integration by parts.
We take u=(logx)2 and dv=dx, so du=x2logxdx, and v=x.
I=x(logx)2−∫x⋅x2logxdx
I=x(logx)2−2∫logxdx
Step 2 — Integrate log x by parts.
We take u=logx and dv=dx, so du=xdx, and v=x.
∫logxdx=xlogx−∫x⋅x1dx
∫logxdx=xlogx−x
Step 3 — Substitute back.
We put this result into Step 1 and multiply out the bracket.
I=x(logx)2−2(xlogx−x)+C
I=x(logx)2−2xlogx+2x+C
Therefore, ∫(logx)2dx=x(logx)2−2xlogx+2x+C.