<s>[INST] How many solutions has this equation? I've the equation $x - \arctan(2x) = a$ and the question is, how many solution has the equation for different values of $a$, where $a$ is a real number.
I've plotted the graph and found the extreme values at $ x = \pm \frac{1}{2}$.
so naturally I would say:
1 solution for $a < -\frac{1}{2}$ and  $a > \frac{1}{2}$
2 solutions for $a = \pm \frac{1}{2}$
and
3 solutions for $ -\frac{1}{2} < a < \frac{1}{2}$
However that's wrong. The solution contains $\pi/4$ too, why? How to solve this?
 [/INST] Differentiating $f(x) = x - \arctan(2x)-a$, we get ${f}'(x) = 1-\frac{2}{1+4x^{2}} = 0$ when $x = \frac{1}{2}$ or $x= -\frac{1}{2}$. If $|x| > -\frac{1}{2}$, then function is increasing. Otherwise, it is decreasing. Thus, $f(x)$ has at most 3 roots and we just have to check the intervals  $x > \frac{1}{2}$,  $x < - \frac{1}{2}$, and $ -\frac{1}{2} \leq x \leq \frac{1}{2}$.
In the first interval, $\arctan(2x) > \pi/4$ and  $x > \frac{1}{2}$ and $f(x)$ is increasing. Thus, if $a$ is greater than $\frac{1}{2} -\pi/4$ then you get a solution on that interval. Otherwise, you do not.
In second interval, $\arctan(2x) < -\pi/4$ and $x < -\frac{1}{2}$ and $f(x)$ is increasing. So we want $f(\frac{1}{2}) > 0$ for us to have a solution on this interval. Hence, $a < \pi/4 -1/2$ gives you a root on this interval. Otherwise, you do not have a root.
Perhaps you can do the third interval case yourself and put it all together and get a solution?
</s>