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&lt;x&lt;\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&lt;x&lt;\pi$$

$$=\tan^{-1}\left(\frac{\sin\left(\frac {\pi}4-x\right)}{\cos\left(\frac {\pi}4-x\right)}\right),\quad 0&lt;x&lt;\pi$$
$$=\begin{cases}
&amp;\frac {\pi}4-x&amp;\quad\text{if}\ \ 0 &lt; x &lt; \frac{3\pi}4\\
&amp;\text{not defined}&amp;\quad\text{if}\quad x = \frac{3\pi}4\\
&amp;\frac {5\pi}4-x&amp;\quad\text{if}\ \ \frac{3\pi}4&lt; x &lt; \pi\\
\end{cases}
$$
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&lt;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}$.