Opalg said:
Hi Pedro and welcome to MHB.
You have made a good start on this problem, and you are right to use integration by parts on the integral $$\int \cos (u)\, e^{u}du$$ (integrating the exponential and differentiating the cosine). That will lead to something looking like $$\int \sin (u)\, e^{u}du$$. The trick now is to integrate that by parts (again integrating the exponential, and differentiating the sine). At first sight, this looks unpromising, because it leads you back to something looking very like what you started out with. But look at it more closely, and you will see that in fact it can be rearranged to give you a formula for $$\int \cos (u)\, e^{u}du$$.
Just to elaborate on Opalg's tip: after substituting $t = \ln(x)$, you correctly ended up with
$$
\int \cos (t)\, e^{t}dt
$$
Now to do integration by parts, begin by proceeding as usual. Take:
$$
u = \cos(t)\\
du = -\sin(t)\,dt\\
dv = e^t dt\\
v = e^t
$$
And you end up with
$$
\int \cos (t)\, e^{t}dt = e^t \cos(t) - \int (-\sin(t)\,e^t dt)\\
=e^t \cos(t) + \int \sin(t)\,e^t dt
$$
Now, in order to do the second integral, we once again integrate by parts, taking
$$
u = \sin(t)\\
du = \cos(t)\,dt\\
dv = e^t dt\\
v = e^t
$$
and ending up with
$$
\int \sin(t)\,e^t dt = \sin(t)e^t - \int \cos(t)e^t dt
$$
Which, substituting the above back in, gives us
$$
\int \cos (t)\,e^t dt = e^t \cos(t) + \sin(t)e^t - \int \cos(t)e^t dt
$$
As you indicated, if we were to continue with integration by parts, the process would never end since we have come full circle. What we will do instead at this point is make the above into an algebra problem. Defining $I = \int \cos(t)e^t dt$ to be our integral, we can rewrite the above equation as
$$
I = e^t \cos(t) + \sin(t)e^t - I + C
$$
From there, we can simply solve for $I$. We find
$$
2I = 2\left[\int \cos(t)e^t dt\right]= e^t \cos(t) + \sin(t)e^t + C\\
I = \int \cos(t)e^t dt =\frac12\left[e^t \cos(t) + \sin(t)e^t\right] + C
$$
Now, to solve the original problem, you have to substitute back in $t=\ln(x)$.