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 \frac{dx}{1-\tan(x)} $$ Please help me to solve this problem as I'm trying this since last 1 day...

share|cite|improve this question
up vote 6 down vote accepted

$$\int \frac 1{1-\tan(x)}dx=\int \frac {\cos(x)}{\cos(x)-\sin(x)}dx$$ $$=\frac 12\int \frac {\cos(x)+\sin(x)+\cos(x)-\sin(x)}{\cos(x)-\sin(x)}dx$$ $$=\frac 12\int 1+\frac {\cos(x)+\sin(x)}{\cos(x)-\sin(x)}dx$$ With the result : $$\int \frac 1{1-\tan(x)}dx=C+\frac {x-\log(\cos(x)-\sin(x))}2$$

share|cite|improve this answer

Hint: Since your integral is as $$\int\frac{\cos(x)\,dx}{\cos(x)-\sin(x)}=\int R(\sin(x),\cos(x))\,dx$$ wherein $R$ is rational function respect to $\sin(x)$ and $\cos(x)$; you can use the following change of variable: $$t=\tan(x/2), -\pi<x<\pi$$

share|cite|improve this answer
For more details see this article. This is called the Weierstrass substitution. – Michael Hardy Aug 29 '12 at 16:41
Nice hint! I hope you read this upon awakening from a peaceful slumber! ;-) – amWhy Mar 14 '13 at 2:04

An alternative is to use the substitution $t=\tan x$ and then expand into partial fractions. $$\begin{equation*} dt=\left( 1+\tan ^{2}x\right) dx=\left( 1+t^{2}\right) dx \end{equation*}$$

$$\begin{equation*} I=\int \frac{1}{1-\tan x}dx=\int \frac{1}{\left( 1-t\right) \left( 1+t^{2}\right) }\,dt. \end{equation*}$$ Since $$\begin{equation*} \frac{1}{\left( 1-t\right) \left( 1+t^{2}\right) }=\frac{1}{2\left( 1-t\right) }+\frac{1}{2}\frac{t}{1+t^{2}}+\frac{1}{2}\frac{1}{1+t^{2}}, \end{equation*}$$ we have $$\begin{eqnarray*} I &=&\frac{1}{2}\int \frac{1}{1-t}\,dt+\frac{1}{2}\int \frac{t}{1+t^{2}}\,dt+ \frac{1}{2}\int \frac{1}{1+t^{2}}\,dt \\ &=&-\frac{1}{2}\ln \left\vert 1-t\right\vert +\frac{1}{4}\ln \left\vert 1+t^{2}\right\vert +\frac{1}{2}\arctan t+C \\ &=&-\frac{1}{2}\ln \left\vert 1-\tan x\right\vert +\frac{1}{4}\ln \left\vert 1+\tan ^{2}x\right\vert +\frac{x}{2}+C \\ &=&-\frac{1}{2}\ln \left\vert 1-\tan x\right\vert +\frac{1}{2}\ln \left\vert \sec x\right\vert +\frac{x}{2}+C. \end{eqnarray*}$$ This can be written as $$\begin{eqnarray*} I &=&-\frac{1}{2}\ln \left\vert \frac{1-\tan x}{\sec x}\right\vert +\frac{x}{ 2}+C \\ &=&-\frac{1}{2}\ln \left\vert \cos x-\sin x\right\vert +\frac{x}{2}+C. \end{eqnarray*}$$

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.