Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$$\int \dfrac{1}{\cos x+\tan x }dx$$

This can be converted to

$$\int \dfrac{\cos x}{\sin x+\cos^2x}dx$$

But from here I get stuck. Using t substitution will get you into a mess. Are there any tricks which can split the fraction into simpler forms?

share|cite|improve this question
The most general solution to this type of problem can be found here: – Thomas Andrews Jun 15 '13 at 13:48
up vote 4 down vote accepted

As commented above the Weirstrass substitution $$ \begin{equation*} t=\tan \frac{x}{2}\Leftrightarrow x=2\arctan t,\,dx=\frac{2}{ 1+t^{2}}dt, \end{equation*} $$ can be applied to the given integral. The integrand becomes a rational fraction in $t$, because $$ \begin{equation*} \cos x=\frac{1-\tan ^{2}\frac{x }{2}}{1+\tan ^{2}\frac{x}{2}}=\frac{1-t^{2}}{1+t^{2}},\,\quad\sin x=\frac{2\tan \frac{x }{2}}{1+\tan ^{2} \frac{x }{2}}=\frac{2t}{1+t^{2}}. \end{equation*} $$ We have $$ \begin{eqnarray*} I &=&\int \frac{1}{\cos x+\tan x}\,dx,\qquad t=\tan \frac{x}{2} \\ &=&\int \frac{2}{\left( \frac{1-t^{2}}{1+t^{2}}+\frac{2t}{1-t^{2}}\right) \left( 1+t^{2}\right) }\,dt \\ &=&\int \frac{2(1-t^{2})}{t^{4}+2t^{3}-2t^{2}+2t+1}\,dt. \end{eqnarray*} $$ Since $$ \begin{equation*} t^{4}+2t^{3}-2t^{2}+2t+1=\left( t^{2}+(1-\sqrt{5})t+1\right) \left( t^{2}+(1+\sqrt{5})t+1\right), \end{equation*} $$ we can expand the integrand into partial fractions $$ \begin{equation*} \frac{2(1-t^{2})}{t^{4}+2t^{3}-2t^{2}+2t+1}=\frac{\sqrt{5}}{5}\left( \frac{2t+1+\sqrt{5}}{t^{2}+(1+\sqrt{5})t+1}-\frac{2t+1-\sqrt{5}}{t^{2}+(1-\sqrt{5})t+1}\right). \end{equation*} $$ Consequently, $$ \begin{equation*} I=\frac{\sqrt{5}}{5}\int \frac{2t+1+\sqrt{5}}{t^{2}+(1+\sqrt{5})t+1}\,dt- \frac{\sqrt{5}}{5}\int \frac{2t+1-\sqrt{5}}{t^{2}+(1-\sqrt{5})t+1}\,dt. \end{equation*} $$ Set $u(t)=t^{2}+(1+\sqrt{5})t+1,v(t)=t^{2}+(1-\sqrt{5})t+1$. Then $$ \begin{eqnarray*} I &=&\frac{\sqrt{5}}{5}\int \frac{u^{\prime }(t)}{u(t)}\,dt-\frac{\sqrt{5}}{5}\int \frac{v^{\prime }(t)}{v(t)}\,dt \\ &=&\frac{\sqrt{5}}{5}\log \left\vert u(t)\right\vert -\frac{\sqrt{5}}{5}\log \left\vert v(t)\right\vert +C \\ &=&\frac{\sqrt{5}}{5}\log \left\vert \frac{t^{2}+(1+\sqrt{5})t+1}{t^{2}+(1-\sqrt{5})t+1}\right\vert +C \\ &=&\frac{\sqrt{5}}{5}\log \left\vert \frac{\tan ^{2}\frac{x}{2}+(1+\sqrt{5})\tan \frac{x}{2}+1}{\tan ^{2}\frac{x}{2}+(1-\sqrt{5})\tan \frac{x}{2}+1}\right\vert +C. \end{eqnarray*} $$

share|cite|improve this answer


$$I=\displaystyle\int \dfrac{\cos x}{\sin x+\cos^2x}dx$$

$$=\displaystyle\int \dfrac{\cos x}{\sin x+1-\sin^2x}dx$$

Put $\sin x=u, \cos xdx=du $

$$\implies I=\int \frac{du}{1+u-u^2}=\int \frac{4du}{5-(2u-1)^2}$$

Put $2u-1=v$ and use Partial Fraction Decomposition or $$\int\frac{dx}{a^2-x^2}=\frac1{2a}\ln\left|\frac{a+x}{a-x}\right|+C $$

share|cite|improve this answer

$$\displaystyle\int \dfrac{\cos x}{\sin x+\cos^2x}dx = \displaystyle\int \dfrac{1}{\sin x+\cos^2x}d\sin x = \displaystyle\int \dfrac{1}{\sin x+(1-\sin^2x)}d\sin x$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.