Integrating $ \int\frac{5}{\ 16 + 9\cos^2(x)}\,dx $ I am trying to integrate the following:
$$
\int\frac{5}{\ 16 + 9\cos^2(x)}\,dx
$$
I have applied the following substitution:
$$
x = \tan^{-1}u
$$
I have simplified the denominator through using the following trig identity:
$$
\cos^{2}x = 1/(1 + \tan^{2}x)
$$
$$
16  + 9(1/(1 + \tan^{2}x))
$$
$$
\frac{16(1 + tan^{2}x) + 9}{\ 1 + \tan^{2}x}\
$$
$$
= \frac{25 + 16\tan^{2}x}{\ 1 + \tan^{2}x}\
$$
Substituting the above into the denominator I get:
$$
5\int\frac{1 + \tan^{2}x}{\ 25 + 16\tan^2(x)}\,dx
$$
However, I know that the result of the above substitution should be:
$$
5\int\frac{1}{\ 16u^{2} + 25}\,du
$$
I am very close to this result except for the fact that the numerator in my integral is $1 + \tan^{2}x$ instead of 1.
I am not sure how I can get rid of the $\tan^{2}x$ in my numerator. Any insights are appreciated.
 A: Notice, you should use $1+\tan^2x=\sec^2x$.
You can get to that integral as follows
$$ =5\int\frac{1+\tan^2x}{\ 16\tan^2 x + 25}\,dx $$
$$ =5\int\frac{\sec^2x}{\ 16\tan^2 x + 25}\,dx $$
Let $\tan x=u\implies \sec^2x\ dx=du$
$$ =5\int\frac{du}{16u^2 + 25} $$
A: Note that $\cos(x)=\frac{1}{\sec(x)}$ and $\sec^2(x)=\tan^2(x)+1$ so the integral becomes:
$$\int\sec^2(x)\times\frac{1}{16\tan^2(x)+25}$$
Substitute $u=\tan(x)$ so that $dx=\frac{1}{sec^2(x)}du$ and the integral becomes:
$$\int\frac{1}{16u^2+25}$$
Now substitute $v=\frac{4u}{5}$ so $du=\frac{5}{4}dv$ and the integral becomes:
$$\frac{1}{20}\int\frac{1}{v^2+1}$$
$$=\frac{\arctan(v)}{20}$$
Substitute $v$ back to get:
$$=\frac{\arctan(\frac{4u}{5})}{20}$$
Then substitute u back to get:
$$=\frac{\arctan(\frac{4\tan(x)}{5})}{20}$$
A: Note that when you got to
$$5\int{1+\tan^2x\over25+16\tan^2x}dx$$
you haven't yet used the substitution $x=\arctan u$. If you notice $x=\arctan u$ implies $dx={du\over1+u^2}$, you see immediately that
$${1+\tan^2x\over25+16\tan^2x}dx={1+u^2\over25+16u^2}\cdot{du\over1+u^2}={1\over25+16u^2}du$$
so the result of the subsitution is indeed
$$5\int{1\over25+16u^2}du$$
