Simplify $\tan^{-1}[(\cos x - \sin x)/(\cos x + \sin x)]$ 
Write the following functions in simplest form:
    $$\tan^{-1}\left(\frac{\cos(x)-\sin(x)}{\cos(x)+\sin(x)}\right), \quad 0<x<\pi$$

Please help me to solve this problem. I have been trying to solve this from last 3 hours. I can solve simple inverse trigonometric functions
 A: Let's multiply the numerator and denominator by $\ \cos\bigl(\frac {\pi}4\bigr)=\sin\bigl(\frac {\pi}4\bigr)\ $ :
$$\tan^{-1}\left(\frac{\sin\bigl(\frac {\pi}4\bigr)\cos(x)-\cos\bigl(\frac {\pi}4\bigr)\sin(x)}{\cos\bigl(\frac {\pi}4\bigr)\cos(x)+\sin\bigl(\frac {\pi}4\bigr)\sin(x)}\right),\quad 0<x<\pi$$
$$=\tan^{-1}\left(\frac{\sin\left(\frac {\pi}4-x\right)}{\cos\left(\frac {\pi}4-x\right)}\right),\quad 0<x<\pi$$
$$=\begin{cases}
&\frac {\pi}4-x&\quad\text{if}\ \ 0 < x < \frac{3\pi}4\\
&\text{not defined}&\quad\text{if}\quad x = \frac{3\pi}4\\
&\frac {5\pi}4-x&\quad\text{if}\ \ \frac{3\pi}4< x < \pi\\
\end{cases}
$$
A: Let $\theta=\tan^{-1}(X)$ where $X=\left(\frac{\cos(x)-\sin(x)}{\cos(x)+\sin(x)}\right)$ and $0<x<\pi$ ,we have $$\frac{1-X}{1+X}=\tan(x)$$ But $\tan(\theta)=X$ so, $\tan(x)=\frac{1-\tan(\theta)}{1+\tan(\theta)}=\tan(\frac{\pi}{4}-\theta)$. The rest is as Raymond concluded above.
A: $$\tan^{-1}\left(\frac{\cos(x)-\sin(x)}{\cos(x)+\sin(x)}\right),\quad 0<x<\pi$$
$=\tan^{-1}\left(\frac{1-\tan(x)}{1+\tan(x)}\right)$ diving  the numerator and denominator by $\cos x$
$=\tan^{-1}\left(\frac{\tan\frac{\pi}{4}-\tan(x)}{1+\tan\frac{\pi}{4}\tan(x)}\right)$ as $\tan\frac{\pi}{4}=1$
$=\tan^{-1}\tan(\frac{\pi}{4}-x)$
$=n\pi+\frac{\pi}{4}-x$  where n is any integer.
The principal value which must lie in $[-\frac{\pi}{2},\frac{\pi}{2}]$,
 will be
$\frac{\pi}{4}-x$ when $\frac{\pi}{4}-x$ lies in that region i.e, $\frac{3\pi}{4}  ≥ x  > -\frac{\pi}{4}$
and   $\pi +\frac{\pi}{4}-x$ elsewhere.
But $0<x<\pi$,
so, if  $\frac{\pi}{2}  ≥ x  ≥ 0$ the principal value =$\frac{\pi}{4}-x$
and  $\frac{5\pi}{4}-x$ elsewhere. 
A: It is  $\tan  ^{-1}\dfrac{\cos  \left(x\right)-\sin  \left(x\right)}{\cos  \left(x\right)+\sin  \left(x\right)}$
We will divide in bracket with cosx to get it in tan form which will be easy for us to simplify
$\implies \tan  ^{-1}\dfrac{\dfrac{\cos  \left(x\right)-\sin  \left(x\right)}{\cos  \left(x\right)}}{\dfrac{\cos  \left(x\right)-\sin  \left(x\right)}{\cos  \left(x\right)}}$
$\implies \tan  ^{-1}\dfrac{1-\tan  \left(x\right)}{1+\cos  \left(x\right)}$
Now we know that $\tan  ^{-1}x + \tan  ^{-1}y= \dfrac{x-y}{1-xy}$ when $xy<1$
and we have the bracket in the same form as $\dfrac{\tan  \left(1\right)-\tan  \left(x\right)}{1-\tan  \left(1\right)\tan  \left(x\right)}$
So we get $\tan  ^{-1} \left(\tan   \left(\dfrac{π}{4}\right) + \tan   \left(X\right)\right)$
i.e $\dfrac{π}{4-x}$.
