Integral of $$$\frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}}\, dx$$$.
Solution
Expand the expression:
$${\color{red}{\int{\frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x}}} = {\color{red}{\int{\left(- \frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} + \frac{1}{\cos^{2}{\left(x \right)}}\right)d x}}}$$
Integrate term by term:
$${\color{red}{\int{\left(- \frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} + \frac{1}{\cos^{2}{\left(x \right)}}\right)d x}}} = {\color{red}{\left(- \int{\frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} + \int{\frac{1}{\cos^{2}{\left(x \right)}} d x}\right)}}$$
Rewrite the integrand in terms of the secant:
$$- \int{\frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} + {\color{red}{\int{\frac{1}{\cos^{2}{\left(x \right)}} d x}}} = - \int{\frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} + {\color{red}{\int{\sec^{2}{\left(x \right)} d x}}}$$
The integral of $$$\sec^{2}{\left(x \right)}$$$ is $$$\int{\sec^{2}{\left(x \right)} d x} = \tan{\left(x \right)}$$$:
$$- \int{\frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} + {\color{red}{\int{\sec^{2}{\left(x \right)} d x}}} = - \int{\frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} + {\color{red}{\tan{\left(x \right)}}}$$
Rewrite in terms of the tangent:
$$\tan{\left(x \right)} - {\color{red}{\int{\frac{\sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x}}} = \tan{\left(x \right)} - {\color{red}{\int{\tan^{2}{\left(x \right)} d x}}}$$
Let $$$u=\tan{\left(x \right)}$$$.
Then $$$x=\operatorname{atan}{\left(u \right)}$$$ and $$$dx=\left(\operatorname{atan}{\left(u \right)}\right)^{\prime }du = \frac{du}{u^{2} + 1}$$$ (steps can be seen »).
Thus,
$$\tan{\left(x \right)} - {\color{red}{\int{\tan^{2}{\left(x \right)} d x}}} = \tan{\left(x \right)} - {\color{red}{\int{\frac{u^{2}}{u^{2} + 1} d u}}}$$
Rewrite and split the fraction:
$$\tan{\left(x \right)} - {\color{red}{\int{\frac{u^{2}}{u^{2} + 1} d u}}} = \tan{\left(x \right)} - {\color{red}{\int{\left(1 - \frac{1}{u^{2} + 1}\right)d u}}}$$
Integrate term by term:
$$\tan{\left(x \right)} - {\color{red}{\int{\left(1 - \frac{1}{u^{2} + 1}\right)d u}}} = \tan{\left(x \right)} - {\color{red}{\left(\int{1 d u} - \int{\frac{1}{u^{2} + 1} d u}\right)}}$$
Apply the constant rule $$$\int c\, du = c u$$$ with $$$c=1$$$:
$$\tan{\left(x \right)} + \int{\frac{1}{u^{2} + 1} d u} - {\color{red}{\int{1 d u}}} = \tan{\left(x \right)} + \int{\frac{1}{u^{2} + 1} d u} - {\color{red}{u}}$$
The integral of $$$\frac{1}{u^{2} + 1}$$$ is $$$\int{\frac{1}{u^{2} + 1} d u} = \operatorname{atan}{\left(u \right)}$$$:
$$- u + \tan{\left(x \right)} + {\color{red}{\int{\frac{1}{u^{2} + 1} d u}}} = - u + \tan{\left(x \right)} + {\color{red}{\operatorname{atan}{\left(u \right)}}}$$
Recall that $$$u=\tan{\left(x \right)}$$$:
$$\tan{\left(x \right)} + \operatorname{atan}{\left({\color{red}{u}} \right)} - {\color{red}{u}} = \tan{\left(x \right)} + \operatorname{atan}{\left({\color{red}{\tan{\left(x \right)}}} \right)} - {\color{red}{\tan{\left(x \right)}}}$$
Therefore,
$$\int{\frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} = \operatorname{atan}{\left(\tan{\left(x \right)} \right)}$$
Simplify:
$$\int{\frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} = x$$
Add the constant of integration:
$$\int{\frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}} d x} = x+C$$
Answer
$$$\int \frac{1 - \sin^{2}{\left(x \right)}}{\cos^{2}{\left(x \right)}}\, dx = x + C$$$A