# How do I solve the integral $\int\frac{\tan x}{\sin^2x+2\cos^2x}\,dx$?

So I need to solve the integral

$$\int \frac { \tan { x } }{ \left( \sin { x } \right) ^{ 2 }+2\left( \cos { x } \right) ^{ 2 } } dx$$

I saw some exercises that suggest I need to use the secant function to solve it but can I do it without it?

$$\int \frac { \tan { x } }{ \left( \sin { x } \right) ^{ 2 }+2\left( \cos { x } \right) ^{ 2 } } dx=\int \frac { \tan { x } }{ \cos ^{ 2 }{ x } \left( 2+\tan ^{ 2 }{ x } \right) } dx=\int \frac { \tan { x } }{ \left( 2+\tan ^{ 2 }{ x } \right) } d\tan { x } \\$$ then sunstitute $z=\tan { x }$ so that $$\\ =\int \frac { z }{ 2+{ z }^{ 2 } } dz=\frac { 1 }{ 2 } \int { \frac { d\left( 2+{ z }^{ 2 } \right) }{ 2+{ z }^{ 2 } } } =\frac { 1 }{ 2 } \ln { \left( 2+{ z }^{ 2 } \right) +C = } \frac { 1 }{ 2 } \ln { \left( 2+\tan ^{ 2 }{ x } \right) +C }$$

• I solved it and I got that it is equal to $\frac{ln(tan^2x+2)}{2}$. Is it right? Oct 18, 2017 at 16:35
• @OvyOvy,yes it is correct Oct 18, 2017 at 16:52
• @user236182,thank you Oct 18, 2017 at 19:14

Let $u=\tan t$ and then \begin{eqnarray} &&\int \frac{\tan x}{(\sin x)^2+2(\cos x)^2}dx\\ &=&\int \frac{\tan x}{\tan^2 x+2}\sec^2x dx\\ &=&\int\frac{u}{u^2+2}du \end{eqnarray} and you can do the rest.

$$\int \frac{\tan x}{(\sin x)^2+2(\cos x)^2}dx=-\int\frac{1}{\cos{x}(1+\cos^2x)}d(\cos{x})=$$ $$=\int\left(\frac{\cos{x}}{1+\cos^2x}-\frac{1}{\cos{x}}\right)d(\cos{x})=\frac{1}{2}\ln(1+\cos^2x)-\ln|\cos{x}|+C.$$

• This is a new low: posting answers before they are completed, on purpose. Shame on you.
– Did
Oct 18, 2017 at 16:29
• Can you please explain how did you use $cosx=t$?
– gbox
Oct 18, 2017 at 16:32
• @gbox It's not necessary. I'll delete this thing. See now please. Oct 18, 2017 at 16:35

\begin{align} \int\frac{\tan x}{\sin^2x+2\cos^2x}\,dx &= \int\dfrac{1}{1+\cos^2x}\dfrac{1}{\cos x}\sin x\,dx \\ &= \int\left(\dfrac{1}{\cos x}-\dfrac{\cos x}{1+\cos^2x}\right)\sin x\,dx \\ &= -\ln\cos x+\dfrac12\ln(1+\cos^2x)+C \end{align}