Integral of $$$\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}}$$$ with respect to $$$x$$$

The calculator will find the integral/antiderivative of $$$\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}}$$$ with respect to $$$x$$$, with steps shown.

Related calculator: Definite and Improper Integral Calculator

Please write without any differentials such as $$$dx$$$, $$$dy$$$ etc.
Leave empty for autodetection.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Your Input

Find $$$\int \frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}}\, dx$$$.

Solution

Multiply the numerator and denominator by $$$\sec^{2}{\left(x \right)}$$$:

$${\color{red}{\int{\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}} d x}}} = {\color{red}{\int{\frac{\sec^{2}{\left(x \right)}}{a^{2} + b^{2} \tan^{2}{\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 here), and we have that $$$\sec^{2}{\left(x \right)} dx = du$$$.

The integral can be rewritten as

$${\color{red}{\int{\frac{\sec^{2}{\left(x \right)}}{a^{2} + b^{2} \tan^{2}{\left(x \right)}} d x}}} = {\color{red}{\int{\frac{1}{a^{2} + b^{2} u^{2}} d u}}}$$

Let $$$v=\frac{u \left|{b}\right|}{\left|{a}\right|}$$$.

Then $$$dv=\left(\frac{u \left|{b}\right|}{\left|{a}\right|}\right)^{\prime }du = \frac{\left|{b}\right|}{\left|{a}\right|} du$$$ (steps can be seen here), and we have that $$$du = \frac{\left|{a}\right| dv}{\left|{b}\right|}$$$.

Therefore,

$${\color{red}{\int{\frac{1}{a^{2} + b^{2} u^{2}} d u}}} = {\color{red}{\int{\frac{\left|{a}\right|}{a^{2} \left(v^{2} + 1\right) \left|{b}\right|} d v}}}$$

Apply the constant multiple rule $$$\int c f{\left(v \right)}\, dv = c \int f{\left(v \right)}\, dv$$$ with $$$c=\frac{\left|{a}\right|}{a^{2} \left|{b}\right|}$$$ and $$$f{\left(v \right)} = \frac{1}{v^{2} + 1}$$$:

$${\color{red}{\int{\frac{\left|{a}\right|}{a^{2} \left(v^{2} + 1\right) \left|{b}\right|} d v}}} = {\color{red}{\frac{\left|{a}\right| \int{\frac{1}{v^{2} + 1} d v}}{a^{2} \left|{b}\right|}}}$$

The integral of $$$\frac{1}{v^{2} + 1}$$$ is $$$\int{\frac{1}{v^{2} + 1} d v} = \operatorname{atan}{\left(v \right)}$$$:

$$\frac{\left|{a}\right| {\color{red}{\int{\frac{1}{v^{2} + 1} d v}}}}{a^{2} \left|{b}\right|} = \frac{\left|{a}\right| {\color{red}{\operatorname{atan}{\left(v \right)}}}}{a^{2} \left|{b}\right|}$$

Recall that $$$v=\frac{u \left|{b}\right|}{\left|{a}\right|}$$$:

$$\frac{\left|{a}\right| \operatorname{atan}{\left({\color{red}{v}} \right)}}{a^{2} \left|{b}\right|} = \frac{\left|{a}\right| \operatorname{atan}{\left({\color{red}{\frac{u \left|{b}\right|}{\left|{a}\right|}}} \right)}}{a^{2} \left|{b}\right|}$$

Recall that $$$u=\tan{\left(x \right)}$$$:

$$\frac{\left|{a}\right| \operatorname{atan}{\left(\frac{\left|{b}\right| {\color{red}{u}}}{\left|{a}\right|} \right)}}{a^{2} \left|{b}\right|} = \frac{\left|{a}\right| \operatorname{atan}{\left(\frac{\left|{b}\right| {\color{red}{\tan{\left(x \right)}}}}{\left|{a}\right|} \right)}}{a^{2} \left|{b}\right|}$$

Therefore,

$$\int{\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}} d x} = \frac{\left|{a}\right| \operatorname{atan}{\left(\frac{\tan{\left(x \right)} \left|{b}\right|}{\left|{a}\right|} \right)}}{a^{2} \left|{b}\right|}$$

Simplify:

$$\int{\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}} d x} = \frac{\left|{\frac{a}{b}}\right| \operatorname{atan}{\left(\tan{\left(x \right)} \left|{\frac{b}{a}}\right| \right)}}{a^{2}}$$

Add the constant of integration:

$$\int{\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}} d x} = \frac{\left|{\frac{a}{b}}\right| \operatorname{atan}{\left(\tan{\left(x \right)} \left|{\frac{b}{a}}\right| \right)}}{a^{2}}+C$$

Answer: $$$\int{\frac{1}{a^{2} \cos^{2}{\left(x \right)} + b^{2} \sin^{2}{\left(x \right)}} d x}=\frac{\left|{\frac{a}{b}}\right| \operatorname{atan}{\left(\tan{\left(x \right)} \left|{\frac{b}{a}}\right| \right)}}{a^{2}}+C$$$