TITLE: Trigonometric integral with cosinus
QUESTION [6 upvotes]: I cannot solve the equation below:
I know what I typed is wrong byt I can't understand where it went sour.
$$\int \frac{1}{\cos(5x)} dx$$
$$\left[
\begin{align*}
5x=s\\
x=\frac{s}{5};
\frac{dx}{ds}=\frac{1}5
\end{align*}
\right]
$$
$$
\frac{1}{5}\int \frac{1}{\cos (s)}\frac{\cos (s)}{\cos (s)}\,ds=
\frac{1}{5}\int \frac{\cos (s)}{\cos^2(s)}\,ds=\frac{1}{5}\int \frac{\cos (s)}{1-\sin^2(s)}\,ds
$$
$$\left[
\begin{align*}
\sin(s)=y\\
\frac{dy}{ds}=-\cos(s)
\end{align*}
\right]
$$
$$
\frac{1}{5} \cdot -\frac{1}{2}\int -\frac{1}{1-y}-\frac{1}{1+y} dy
$$
$$
\left[ -(-\ln(1-y) - \ln(1+y)\right]
=
\left[ \ln\frac{(1-y)}{(1+y)}\right]
=
\left[ \ln\frac{(1-\sin(s))}{(1+\sin(s))}\right]
=
\left[ \ln\frac{(1-\sin(5x))}{(1+\sin(5x))}\right]
$$

REPLY [3 votes]: Interestingly, you can work this out with the unintuitive subsitution $u=\sin 5x$ directly.
$$x=\frac15\arcsin u,dx=\frac15\dfrac{du}{\sqrt{1-u^2}},\\\int\frac{dx}{\cos 5x}=\frac15\int\frac{du}{\sqrt{1-u^2}\sqrt{1-u^2}}=\frac15\int\frac{du}{1-u^2}.
$$
The last integral is elementary, giving
$$\frac15\int\frac{du}{1-u^2}=\frac15\text{artanh }u=\frac15\text{artanh}(\sin 5x).$$

If you never heard of the hyperbolic functions, notice the similarity with the ordinary arc tangent, and check the logarithm-based formula. Of course, you get the same result with fraction decomposition.