TITLE: The integral $\int\ln(x)\cos(1+(\ln(x))^2)\,dx$
QUESTION [6 upvotes]: Help with a integral calculus please!?
The equation is 
$$\int\ln(x)\cos(1+(\ln(x))^2)\,dx$$
My teacher told me, i have to use substitution? but i can't still solve it.
I've been solving this last week but still i can't get the answer, please help me guys. Thanks!

REPLY [2 votes]: First, consider the following integral:
$$I(t)=\int\sin(1+(t+\ln(x))^2)\ dx$$
By letting $x=e^u$ and $\sin(\theta)=\Im(e^{i\theta})$, we get
$$I(t)=\int e^u\sin(1+(t+u)^2)\ du=\Im\int e^{u+(1+(t+u)^2)i}\ du$$
This may then be solving using the error function,
$$\int e^{u+(1+(t+u)^2)i}\ du=\frac{-\sqrt{\pi i}e^{i+\frac{(2it+1)^2}{4i}}\operatorname{erf}\left(\frac{2iu+2it+1}2\sqrt i\right)}2$$
It then follows that
$$I'(t)=\frac d{dt}\int\sin(1+(t+\ln(x))^2)\ dx=\int2(t+\ln(x))\cos(1+(t+\ln(x))^2)\ dx\\I'(t)=\Im\frac d{dt}\frac{-\sqrt{\pi i}e^{i+\frac{(2it+1)^2}{4i}}\operatorname{erf}\left(\frac{2iu+2it+1}2\sqrt i\right)}2$$
Thus,
$$\frac12I'(0)=\int\ln(x)\cos(1+(\ln(x))^2)\ dx$$
Evaluating the derivative, one gets
$$\begin{align}\frac12I'(t)&=\Im\frac{-\sqrt{\pi i}}4\frac d{dt}e^{i+\frac{(2it+1)^2}{4i}}\operatorname{erf}\left(\frac{2iu+2it+1}2\sqrt i\right)\\&=\Im\frac{-\sqrt{\pi i}}4e^{i+\frac{(2it+1)^2}{4i}}\left[(2it+1)\operatorname{erf}\left(\frac{2iu+2it+1}2\sqrt i\right)+\frac{4i}{\sqrt\pi}e^{-\left(\frac{2iu+2it+1}2\sqrt i\right)^2}\right]\end{align}$$
Finally,

$$\int\ln(x)\cos(1+(\ln(x))^2)\ dx=\Im\frac{-\sqrt{\pi i}}4\left[e^{i+\frac1{4i}}\left[\operatorname{erf}\left(\frac{2iu+1}2\sqrt i\right)+\frac{4i}{\sqrt\pi}e^{-\left(\frac{2iu+1}2\sqrt i\right)^2}\right]\right]$$

Where $u=\ln(x)$.