There is no mistake.
There is none. I assume you are surprised because the answer book or whatever says
Both answers only differ by a constant, which disappears once you make the integral definite:
Both the answers are right, You could have made the substitution as
Just change the substitution and you would get the desired answer.
u = cos(ln(x))
Now du = (-sin(ln(x)))/x dx
Thus the integral becomes
-∫▒udu = -u^2/2+C = - 〖cos〗^2 (ln(x) )+C