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