Solution:
Key idea: We write each integrand as (function)⋅1 and integrate by parts, ∫uvdx=u∫vdx−∫(dxdu∫vdx)dx, with 1 as the second function. Each integral produces the other, so we solve the pair together. Let I1=∫cos(logx)dx and I2=∫sin(logx)dx. The integrands need x>0.
Step 1 — Find the derivatives needed.
By the chain rule, with dxdlogx=x1:
dxdcos(logx)=−xsin(logx)
dxdsin(logx)=xcos(logx)
Step 2 — Parts on I1.
We take u=cos(logx) and v=1; the x from ∫1dx cancels the x1.
I1=xcos(logx)−∫x(−xsin(logx))dx
I1=xcos(logx)+I2
Step 3 — Parts on I2.
We take u=sin(logx) and v=1 in the same way.
I2=xsin(logx)−∫x⋅xcos(logx)dx
I2=xsin(logx)−I1
Step 4 — Solve for I1, part (i).
We put the result of Step 3 into Step 2 and solve.
I1=xcos(logx)+xsin(logx)−I1
2I1=x[cos(logx)+sin(logx)]
I1=2x[cos(logx)+sin(logx)]+C
Step 5 — Find I2, part (ii).
We put I1 from Step 4 into Step 3 and simplify.
I2=xsin(logx)−2xcos(logx)−2xsin(logx)
I2=2x[sin(logx)−cos(logx)]+C
Therefore, for x>0: (i) ∫cos(logx)dx=2x[cos(logx)+sin(logx)]+C; (ii) ∫sin(logx)dx=2x[sin(logx)−cos(logx)]+C.