Evaluate the following integrals:
Question:

Evaluate the following integrals:

$\int\left\{3 \sin x-4 \cos x+\frac{5}{\cos ^{2} x}-\frac{6}{\sin ^{2} x}+\tan ^{2} x-\cot ^{2} x\right\} d x$

Solution:

Let $I=\int\left\{3 \sin x-4 \cos x+\frac{5}{\cos ^{2} x}-\frac{6}{\sin ^{2} x}+\tan ^{2} x-\cot ^{2} x\right\} d x$

$\Rightarrow I=\int\left\{3 \sin x-4 \cos x+5 \sec ^{2} x-6 \operatorname{cosec}^{2} x+\tan ^{2} x-\cot ^{2} x\right\} d x$

We have $\sec ^{2} \theta-\tan ^{2} \theta=\operatorname{cosec}^{2} \theta-\cot ^{2} \theta=1$

$\Rightarrow I=\int\left\{3 \sin x-4 \cos x+5 \sec ^{2} x-6 \operatorname{cosec}^{2} x+\left(\sec ^{2} x-1\right)\right.$

$\left.-\left(\operatorname{cosec}^{2} x-1\right)\right\} d x$

$\Rightarrow I=\int\left\{3 \sin x-4 \cos x+5 \sec ^{2} x-6 \operatorname{cosec}^{2} x+\sec ^{2} x-1-\operatorname{cosec}^{2} x\right.$

$+1\} d x$

$\Rightarrow I=\int\left\{3 \sin x-4 \cos x+6 \sec ^{2} x-7 \operatorname{cosec}^{2} x\right\} d x$

$\Rightarrow I=\int 3 \sin x d x-\int 4 \cos x d x+\int 6 \sec ^{2} x d x-\int 7 \operatorname{cosec}^{2} x d x$

$\Rightarrow I=3 \int \sin x d x-4 \int \cos x d x+6 \int \sec ^{2} x d x-7 \int \operatorname{cosec}^{2} x d x$

Recall $\int \sec ^{2} x d x=\tan x+c$ and $\int \sin x d x=-\cos x+c$

We also have $\int \operatorname{cosec}^{2} x d x=-\cot x+c$ and $\int \cos x d x=\sin x+c$

$\Rightarrow I=3(-\cos x)-4(\sin x)+6(\tan x)-7(-\cot x)+c$

$\therefore I=-3 \cos x-4 \sin x+6 \tan x+7 \cot x+c$

Thus,

$\int\left\{3 \sin x-4 \cos x+\frac{5}{\cos ^{2} x}-\frac{6}{\sin ^{2} x}+\tan ^{2} x-\cot ^{2} x\right\} d x=-3 \cos x-4 \sin x+$

$6 \tan x+7 \cot x+c$