The range of the function $f:\mathbb{R}\to \mathbb{R}$ given by $f(x)=\frac{3+2 \sin x}{\sqrt{1+ \cos x}+\sqrt{1- \cos x}}$ The range of the function $f:\mathbb{R}\to \mathbb{R}$ given by $f(x)=\frac{3+2 \sin x}{\sqrt{1+ \cos x}+\sqrt{1- \cos x}}$ contains $N$ integers. Find the value of $10N$.
I tried to find the minimum and maximum value of the function.First i simplified the function.
$f(x)=\frac{3+2 \sin x}{\sqrt{1+ \cos x}+\sqrt{1- \cos x}}=\frac{1+4\sin^2\left(\frac{x}{2}+\frac{\pi}{4}\right)}{2\sin \left(\frac{x}{2}+\frac{\pi}{4}\right)}$
Then i differentiated the function and equate it to zero to get the critical points.
Critical point equations are $\cos\left(\frac{x}{2}+\frac{\pi}{4}\right)=0$
$\sin\left(\frac{x}{2}+\frac{\pi}{4}\right)=\frac{1}{2},\sin\left(\frac{x}{2}+\frac{\pi}{4}\right)=\frac{-1}{2}$
When i checked plotted the function on desmos.com graphing calculator,i found minimum value to be $0.5$ and maximum value to be $2.5$.
Which i cannot get by my critical points.Where have i gone wrong?Please help me. 

Put $\sqrt{1+\cos x}$ +$\sqrt{1-\cos x} = A$ 
$A^2 = 2\pm 2 \sin x ,\quad A^2 - 2 =\pm 2 \sin x$
$ -2\leq A^2 - 2\leq 2,\quad -2\leq A\leq2$
So $f(x) = \frac{5 - A^2}{A}$  or $\frac{A^2 + 1}{A}$   
Find the minimum and maximum of $f(x)$ in the two conditions with  $-2\leq A\leq 2$
