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

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}
$$
