#int cos(ln x) dx#
Consider instead:
#int cos(ln x ) + i sin(ln x ) dx#
Chosen because we can use of Euler's Formula
#= int e^(i ln x ) dx#
#= int e^( ln x^i ) dx#
#= int x^i dx#
#= x^(i + 1)/(i + 1) + C#
And the we reverse back into the original form:
#= e^( (ln x^(i+1)) )/(i+1) + C#
#= e^((i + 1) (ln x ) )/(i+1) + C#
#= (e^(i ln(x)) e^(ln(x)) )/(i+1) + C#
#= (( cos(ln x ) + i sin(ln x )) x )/(i+1) + C#
Use the conjugate of the denominator:
#= ((1-i)( cos(ln x) + i sin(ln x )) x )/((i+1)(- i + 1)) + C#
#= (( cos(ln x) + i sin(ln x ) - i cos (ln x) + sin (ln x)) x )/2 + C#
#= (x ( cos(ln x) + sin (ln x)) )/2 + (i x( sin(ln x) - cos(ln x ) ))/2 + C#
We started with a real integrand so we take the first term and the constant:
#implies int cos(ln x) dx = (x ( cos(ln x) + sin (ln x)) )/2 + C#