Example 2. Find the indefinite integral

$$
\int \frac{3 \operatorname{tg}^{2} x-1}{\operatorname{tg}^{2} x+5} d x
$$
Solution.

1. Since the integrand has the form $R(\operatorname{tg} x)$, we make the substitution $\operatorname{tg} x=t$.

Substituting into the integrand

$$
\operatorname{tg} x=t, \quad d x=\frac{d t}{1+t^{2}}
$$

we get

$$
\frac{3 \operatorname{tg}^{2} x-1}{\operatorname{tg}^{2} x+5} d x=\frac{3 t^{2}-1}{t^{2}+5} \frac{1}{1+t^{2}} d t
$$

2. Applying the formula for substitution in an indefinite integral

$$
\int \frac{3 \operatorname{tg}^{2} x-1}{\operatorname{tg}^{2} x+5} d x=\int \frac{3 t^{2}-1}{t^{2}+5} \frac{1}{1+t^{2}} d t
$$

4. We compute the antiderivative of the rational function $t$ :

$$
\int \frac{3 t^{2}-1}{\left(t^{2}+5\right)\left(1+t^{2}\right)} d t=-\operatorname{arctg} t+\frac{4}{\sqrt{5}} \operatorname{arctg} \frac{t}{\sqrt{5}}+C
$$

Returning to the variable $x$, substituting $t=\operatorname{tg} x$ :

$$
\int \frac{3 \operatorname{tg}^{2} x-1}{\operatorname{tg}^{2} x+5} d x=-x+\frac{4}{\sqrt{5}} \operatorname{arctg}\left(\frac{\operatorname{tg} x}{\sqrt{5}}\right)+C
$$

Answer. $\int \frac{3 \operatorname{tg}^{2} x-1}{\operatorname{tg}^{2} x+5} d x=-x+\frac{4}{\sqrt{5}} \operatorname{arctg}\left(\frac{\operatorname{tg} x}{\sqrt{5}}\right)+C$.

Conditions of the Problems. Find the indefinite integrals.

1. $\int \frac{d x}{2 \sin x-\cos x-1}$.
2. $\int \frac{d x}{\cos 2 x-\sin 2 x}$.
3. $\int \frac{d x}{\cos x+2 \sin x+3}$.
4. $\int \frac{d x}{2-\sin x}$.
5. $\int \frac{d x}{4 \cos x-3 \sin x-5}$.
6. $\int \frac{2 \sin x+3 \cos x}{\sin ^{2} x \cos x+9 \cos ^{3} x} d x$.
7. $\int \frac{d x}{1+\sin ^{2} x}$.
8. $\int \frac{\cos ^{5} x+\cos ^{3} x}{\sin ^{4} x+\sin ^{2} x} d x$.
9. $\int \frac{d x}{\sin x(1+\cos x)} d x$.
10. $\int \frac{\cos x}{1+\cos x} d x$.

Answers.

1. $\frac{1}{2} \ln \left|2 \operatorname{tg} \frac{x}{2}-1\right|+C . \quad$ 2. $\frac{1}{2 \sqrt{2}} \ln \left|\frac{\operatorname{tg} x+1+\sqrt{2}}{\operatorname{tg} x+1-\sqrt{2}}\right|+C$.
2. $\operatorname{arctg}\left(1+\operatorname{tg} \frac{x}{2}\right)+C$.
3. $\frac{2}{\sqrt{3}} \operatorname{arctg}\left(\frac{2 \operatorname{tg} \frac{x}{2}-1}{\sqrt{3}}\right)+C$.
4. $2\left(3+9 \operatorname{tg} \frac{x}{2}\right)^{-1}+C$.
5. $\ln \left(\operatorname{tg}^{2} x+9\right)+\operatorname{arctg}\left(\frac{\operatorname{tg} x}{3}\right)+C$.
6. $\frac{1}{\sqrt{2}} \operatorname{arctg}(\sqrt{2} \operatorname{tg} x)+C$.
7. $\sin x-\frac{2}{\sin x}-6 \operatorname{arctg}(\sin x)+C$.
8. $\frac{1}{4} \ln \frac{1-\cos x}{1+\cos x}+\frac{1}{2(1+\cos x)}+C$.
9. $x-\operatorname{tg} \frac{x}{2}+C$.

## 7.7. Integration of Expressions

 $\sin ^{2 m} x \cos ^{2 n} x$Problem Statement. Find the indefinite integral

$$
\int \sin ^{2 m} x \cos ^{2 n} x d x
$$

where $m, n$ are natural numbers.

Plan of Solution.

We apply the formulas for reducing the degree

$$
\sin ^{2} x=\frac{1}{2}(1-\cos 2 x), \quad \cos ^{2} x=\frac{1}{2}(1+\cos 2 x), \quad \sin x \cos x=\frac{1}{2} \sin 2 x
$$

until we arrive at tabular integrals or integrals that can be reduced to tabular ones in a known manner.