How to evaluate integrals of type $\int\frac{\cos^2x}{\cos^2x+ 4\sin^2x}\,dx$ I think it is by substitution but I don't  have any clue on how to go further. Should I substitute $$\sin^2x=t~?$$
$$\int\frac{\cos^2x}{\cos^2x+ 4\sin^2x}\,dx$$
 A: \begin{gather*}
\int \frac{\cos^{2} x}{\cos^{2} x+4\sin^{2} x} dx\\
I=\int \frac{1}{1+4\tan^{2} x} dx\\
Let\ \tan x\ =t\\
\sec^{2} x\ dx=dt\\
dx=\frac{dt}{1+t^{2}}\\
I=\ \int \frac{dt}{\left( 1+t^{2}\right)\left( 1+4t^{2}\right)} =\frac{1}{3}\int \left(\frac{dt}{t^{2} +\frac{1}{4}} -\frac{dt}{t^{2} +1}\right)\\
\end{gather*}
The last expression is attained by using the method of partial fractions, and is solvable by standard integration techniques.
Hope this helps!
A: Simplify the denominator by using $\sin^2x+\cos^2x=1$ and then try to express the resultant wholly in terms of $\tan x$. Then substitute $u= \tan x$. Its pretty much just applying standard identities from there onwards.
A: After dividing by $$cos^2x$$ I got $$\int1/(1+4tan^2x)\,dx$$
And solving it, my answer is $$(arctan(2tanx))/2$$. Is this correct? The answer given in textbook is different. It is
$$(-1/3)arctan(tanx)-(2/3)arctan(2tanx)$$
I graphed my solution and the one in textbook. They are different. Then how to know, which substitution will give me a correct answer?
A: In general, for the integral of an arbitrary rational function of trigonometric functions, the trick is to use the Weierstrass substitution $t=\tan(x/2).$ Then
$$\sin x=\dfrac{2t}{1+t^2},\qquad \cos x=\dfrac{1-t^2}{1+t^2},\qquad \tan x=\dfrac{2t}{1-t^2},\qquad dx=\dfrac{2}{1+t^2}dt$$ transform the original integral to an integral of a rational function, which can solve via partial fractions. The problem that you have posted here has even simpler solution. Note that $$\sin^2x=\dfrac{\tan^2x}{1+\tan^2x},\qquad\text{and}\qquad \cos^2x=\dfrac{1}{1+\tan^2x}.$$ Hence $T=\tan x$ would make a perfectly good substation. Then $$\int\frac{\cos^2x}{\cos^2x+ 4\sin^2x}\,dx=\int\dfrac{1}{(1+4T^2)(1+T^2)}\,dT=\dfrac{1}{3}\int\left(\dfrac{4}{1+4T^2}-\dfrac{1}{1+T^2}\right)\,dT$$
Added: This second substitution is secretly again the Weierstrass substitution. This is a consequence of the fact that $$\sin^2x=\dfrac{1}{2}(1-\cos (2x)),\qquad \cos^2x=\dfrac{1}{2}(1+\cos (2x)).$$
A: Integrate as follows
\begin{align}
\int\frac{\cos^2x}{\cos^2x+ 4\sin^2x}\,dx
=\frac13 \int\left( -1+ \frac{4}{4-3\cos^2x}\right)dx\\
=-\frac13x +  \frac13\int  \frac{\sec^2x}{\frac14+\tan^2x}dx\\
=-\frac13x +  \frac23 \tan^{-1}(2\tan x)+C
\end{align}
