Problem 163
Medium Hyperbolic Integrals and Integration by Parts

Evaluate the integral: I = integral cos(ln x) dx

Evaluate the integral: $$ I = \int \cos(\ln x)\,dx. $$

Explanation of Method

Substituting $t=\ln x$ (so $x=e^t$) converts the integral into $\int e^t\cos t\,dt$, resolved by the same self-referential integration-by-parts technique used in Problem 162.

  1. Substitute $t=\ln x$.
  2. Apply integration by parts twice to $\int e^t\cos t\,dt$.
  3. Solve algebraically for the integral.
  4. Substitute back and simplify.

Step 1 · Substitution

Let $t=\ln x$, so $x=e^t$ and $dx=e^t\,dt$:

$$ I = \int \cos(\ln x)\,dx = \int \cos t\cdot e^t\,dt. $$

Step 2 · First integration by parts

Let $u=\cos t$, $dv=e^t dt$, so $du=-\sin t\,dt$, $v=e^t$:

$$ \int e^t\cos t\,dt = e^t\cos t + \int e^t\sin t\,dt. $$

Step 3 · Second integration by parts

For $\displaystyle\int e^t\sin t\,dt$, let $u=\sin t$, $dv=e^t dt$, so $du=\cos t\,dt$, $v=e^t$:

$$ \int e^t\sin t\,dt = e^t\sin t - \int e^t\cos t\,dt. $$

Step 4 · Solve for the integral

Substituting back, and writing $I$ for $\int e^t\cos t\,dt$:

$$ I = e^t\cos t + \left(e^t\sin t - I\right) \quad \Rightarrow \quad 2I = e^t(\sin t+\cos t). $$

So:

$$ I = \frac{e^t}{2}(\sin t+\cos t) + C. $$

Substituting back $t=\ln x$, $e^t=x$:

$$ I = \frac{x}{2}\left(\sin(\ln x)+\cos(\ln x)\right) + C. $$


Summary Table

Quantity Value
Substitution$t=\ln x,\;x=e^t$
Reduced integral$\int e^t\cos t\,dt$
Antiderivative (in $t$)$\tfrac{e^t}{2}(\sin t+\cos t)$

Additional Notes

Result

The solution to the integral is:

$$ I = \frac{x}{2}\left(\sin(\ln x)+\cos(\ln x)\right) + C. $$