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.