Solution:
Key idea: We write the integrand as cot−1x⋅1 and integrate by parts, ∫uvdx=u∫vdx−∫(dxdu∫vdx)dx, with u=cot−1x and v=1.
Step 1 — Find the pieces needed.
We use the standard derivative of cot−1x and ∫1dx=x.
dxdu=−1+x21
Step 2 — Apply the parts formula.
We put these into the formula; the two minus signs make a plus.
I=xcot−1x−∫x(−1+x21)dx
I=xcot−1x+∫1+x2xdx
Step 3 — Finish the remaining integral.
The numerator x is half the derivative of 1+x2, so we use ∫f(x)f′(x)dx=log∣f(x)∣.
∫1+x2xdx=21∫1+x22xdx
∫1+x2xdx=21log(1+x2)
Step 4 — Combine.
We put this back into Step 2 and add the constant (1+x2>0, so no modulus is needed).
I=xcot−1x+21log(1+x2)+C
Therefore, ∫cot−1xdx=xcot−1x+21log(1+x2)+C.