Find the Maximum and minimum values of $f(x)=\frac{\cos x- \sin x}{\cos x+\sin x}, x\geq0 $ tanx$ \neq -1$
I've tried to find the derivative: $$ f'(x)= \frac{-(\cos x+\sin x)(\sin x+\cos x)-(\cos x-\sin x)^2}{(\cos x+\sin x)^2}$$ $$f'(x)=\frac{-2}{ (\cos x+\sin x)^2 }$$
$f'(x)<0$ as tan x $\neq$ -1
$x\geq 0 \Rightarrow f(x)<f(0)$
$f(x)<1$.
So maximum value is 1. Is this correct? What is the minimum value?
Hint: Divide by $\cos x$.
$$\dfrac{\cos x-\sin x}{\cos x+\sin x}$$ $$=\dfrac{1-\tan x}{1+\tan x}$$ $$=\dfrac{\tan\left(\dfrac{\pi}{4}\right)-\tan x}{1+\tan\left(\dfrac{\pi}{4}\right)\cdot\tan x}$$ $$=\tan\left(\frac{\pi}{4}-x\right)$$
Therefore the range of this function extends from $-\infty$ to $+\infty$.