2. Determine the number of real roots of the equation $x^{2}+4=a|x|$ depending on the real parameter $a$.

(Mária Dományová)
SOLUTION. First, let's present the graphical solution of the problem. The graph of the function on the left side of the equation is a parabola opening upwards, which has its vertex at the point $[0,4]$. The graph of the function on the right side is a pair of rays originating from the origin, which are symmetric with respect to the $y$-axis. The ray pointing to the right (the graph of the function for $x>0$) has a slope of $a$, and the ray pointing to the left has a slope of $-a$.

Note that the entire situation is symmetric with respect to the $y$-axis (both functions $x^{2}+4$ and $a|x|$ are even). Therefore, there can be three cases. For sufficiently small values of $a$, the rays will not intersect the parabola (this will be the case for every $a \leqq 0$ and also for some $a>0$ as shown in the first figure) - the equation will then have no real roots. For a certain critical value $a=a_{0}>0$, both rays will be tangents to the parabola (see the second figure) - in that case, the equation will have 2 real roots. For values $a>a_{0}$, each of the two rays will intersect the parabola at two points (third figure) - the equation will then have a total of 4 real roots. It is therefore sufficient to calculate this critical value $a_{0}>0$. For it, the quadratic equation $x^{2}+4=a_{0} x$ must have exactly one double root, which occurs precisely when its discriminant $a_{0}^{2}-16$ is zero. This is satisfied by the only positive $a_{0}=4$ (the double root is then indeed the positive number $x=2$).
![](https://cdn.mathpix.com/cropped/2024_04_17_e8a9d2201357bccae2b6g-3.jpg?height=478&width=1170&top_left_y=1268&top_left_x=448)

Conclusion. For every $a>4$, the equation has 4 real roots, for $a=4$ it has 2 real roots, and for any $a<4$ it has no real roots.