When is $\sin(x) = \cos(x)$? How do I solve the following equation?
$$\cos(x) - \sin(x) = 0$$ 
I need to find the minimum and maximum of this function: 
$$f(x) = \frac{\tan(x)}{(1+\tan(x)^2}$$
I differentiated it, and in order to find the stationary points I need to put the numerator equal to zero. But I can't find a way to solve this trigonometric equation.

Approach $1$ (Squaring):
$$(\sin x-\cos x)^2=0$$
$$(\sin^2x+\cos^2x)-2\sin x\cos x=0$$
$$1-\sin2x=0$$
$$\sin2x=1$$
$$2x=\frac{\pi}2+2n\pi,n\in\Bbb{N}$$
$$x=\frac{\pi}4+n\pi,n\in\Bbb{N}$$

Approach $2$ (By definition of $\sin x$ and $\cos x$):
$$\cos t=\frac{e^{it}+e^{-it}}2=\frac{e^{it}-e^{-it}}{2i}=\sin t$$
$$(1+i)e^{-it}=(1-i)e^{it}$$
$$e^{2it}=\frac{1+i}{1-i}=i$$
$$\cos2t+i\sin2t=i$$
$$\implies\cos 2t=0 \text{ }\cap \sin2t=1$$
$$x=\frac{\pi}4+n\pi,n\in\Bbb{N}$$
