Consider the equation:
$$x^2 - |x| = m x (x+1)$$
where $m \in \mathbb{R}$. I have to find the set $M$:
$$M=\{ m \in \mathbb{R} | \text{the equation has exactly $3$ real and distinct roots} \}$$
This is what I tried:
$$x^2 - |x| = m x (x+1)$$
$$x^2 - |x| - m x (x+1) = 0$$
This is equivalent to finding the solutions of the equation $f(x) = 0$, where we have:
$$f:\mathbb{R} \rightarrow \mathbb{R} \hspace{2cm} f(x) = x^2 - |x| - mx(x+1)$$
And we need to find $m \in \mathbb{R}$ such that $f(x) = 0$ has exactly $3$ real and distinct solutions.
We have:
$$f(x) = \begin{cases} x^2-x-mx^2-mx & x \ge 0 \\ x^2+x-mx^2-mx & x < 0 \\ \end{cases} $$
$$f(x) = \begin{cases} (1-m)x^2-(1+m)x & \ge 0 \\ (1-m)x^2 +(1-m)x & x < 0 \\ \end{cases} $$
I don't know how to continue from here. I have to find the set of values of $m$ such that we have $3$ real and distinct solutions for $f(x) = 0$. I think that means we would have $2$ real and distinct solutions for one branch of the above piece-wise function and $1$ solution for the other branch of the function, but I don't know how to use that reasoning to find $m$.
Hint: you can rewrite $x^2$ as $|x|^2$ then you can go somehow a little bit easy, because one root is $x=0$ then you can take two way of $x>0 ,x<0$
if you think twice $x=-1 $ is always one of roots. so you need to find other root.
$$x^2 - |x| = m x (x+1)\\ |x|^2 - |x| = m x (x+1)\\ |x|(|x|-1) = m x (x+1)\\x\neq 0 \\ \pm \not x(|x|-1) = m \not x (x+1)$$ I think it easy to solve an eaution with degree one rather than degree two... https://www.desmos.com/calculator/lgeokgpnqj
another point of view is to use draw left-hand side as a function and right-hand side as a function too in one coordinate.