Integral of $$$\frac{\sec{\left(x \right)}}{\sin{\left(x \right)}}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \frac{\sec{\left(x \right)}}{\sin{\left(x \right)}}\, dx$$$.
Solution
Simplify the integrand:
$${\color{red}{\int{\frac{\sec{\left(x \right)}}{\sin{\left(x \right)}} d x}}} = {\color{red}{\int{\frac{2}{\sin{\left(2 x \right)}} d x}}}$$
Rewrite the sine using the double angle formula $$$\sin\left(2 x\right)=2\sin\left(\frac{2 x}{2}\right)\cos\left(\frac{2 x}{2}\right)$$$:
$${\color{red}{\int{\frac{2}{\sin{\left(2 x \right)}} d x}}} = {\color{red}{\int{\frac{1}{\sin{\left(x \right)} \cos{\left(x \right)}} d x}}}$$
Multiply the numerator and denominator by $$$\sec^2\left(x \right)$$$:
$${\color{red}{\int{\frac{1}{\sin{\left(x \right)} \cos{\left(x \right)}} d x}}} = {\color{red}{\int{\frac{\sec^{2}{\left(x \right)}}{\tan{\left(x \right)}} d x}}}$$
Let $$$u=\tan{\left(x \right)}$$$.
Then $$$du=\left(\tan{\left(x \right)}\right)^{\prime }dx = \sec^{2}{\left(x \right)} dx$$$ (steps can be seen »), and we have that $$$\sec^{2}{\left(x \right)} dx = du$$$.
Therefore,
$${\color{red}{\int{\frac{\sec^{2}{\left(x \right)}}{\tan{\left(x \right)}} d x}}} = {\color{red}{\int{\frac{1}{u} d u}}}$$
The integral of $$$\frac{1}{u}$$$ is $$$\int{\frac{1}{u} d u} = \ln{\left(\left|{u}\right| \right)}$$$:
$${\color{red}{\int{\frac{1}{u} d u}}} = {\color{red}{\ln{\left(\left|{u}\right| \right)}}}$$
Recall that $$$u=\tan{\left(x \right)}$$$:
$$\ln{\left(\left|{{\color{red}{u}}}\right| \right)} = \ln{\left(\left|{{\color{red}{\tan{\left(x \right)}}}}\right| \right)}$$
Therefore,
$$\int{\frac{\sec{\left(x \right)}}{\sin{\left(x \right)}} d x} = \ln{\left(\left|{\tan{\left(x \right)}}\right| \right)}$$
Add the constant of integration:
$$\int{\frac{\sec{\left(x \right)}}{\sin{\left(x \right)}} d x} = \ln{\left(\left|{\tan{\left(x \right)}}\right| \right)}+C$$
Answer
$$$\int \frac{\sec{\left(x \right)}}{\sin{\left(x \right)}}\, dx = \ln\left(\left|{\tan{\left(x \right)}}\right|\right) + C$$$A