To find the number of solutions to \( |x^2 - 4| = 2x + k \), we consider the intersections of the curve \( y = |x^2 - 4| \) and the line \( y = 2x + k \).
The curve is defined piecewise:
- Inner arch: \( y = 4 - x^2 \) for \( -2 \le x \le 2 \)
- Outer branches: \( y = x^2 - 4 \) for \( x < -2 \) and \( x > 2 \)
1. **Intersection with the inner arch (\( -2 \le x \le 2 \)):**
\[ 4 - x^2 = 2x + k \iff x^2 + 2x + (k - 4) = 0 \]
For two distinct real intersections, the discriminant must be strictly positive:
\[ \Delta = 2^2 - 4(1)(k - 4) = 20 - 4k > 0 \implies k < 5 \]
At \( k = 5 \), \( \Delta = 0 \), so the line is tangent to the inner arch at \( x = -1 \in (-2, 2) \), giving only 1 intersection point.
Furthermore, the roots must lie within the interval \( [-2, 2] \). The lower critical value occurs when the line passes through the corner intercept \( (-2, 0) \):
\[ 0 = 2(-2) + k \implies k = 4 \]
At \( k = 4 \), the equation becomes \( x^2 + 2x = 0 \implies x = 0 \) or \( x = -2 \). Because \( x = -2 \) is the boundary corner shared with the outer branch, the total number of distinct solutions is 3.
For \( 4 < k < 5 \), the roots are \( x = -1 \pm \sqrt{5 - k} \). Since \( 0 < 5 - k < 1 \), we have \( \sqrt{5 - k} \in (0, 1) \), which guarantees both roots strictly lie in \( (-2, 0) \subset (-2, 2) \). Hence, there are exactly 2 distinct solutions on the inner arch.
2. **Intersection with the outer branches (\( x < -2 \) or \( x > 2 \)):**
\[ x^2 - 4 = 2x + k \iff x^2 - 2x - (k + 4) = 0 \]
The discriminant is:
\[ \Delta = (-2)^2 - 4(1)(-(k + 4)) = 4k + 20 \]
For \( 4 < k < 5 \), \( \Delta \in (36, 40) > 0 \), yielding roots \( x = 1 \pm \sqrt{k + 5} \).
Since \( 9 < k + 5 < 10 \), \( 3 < \sqrt{k + 5} < \sqrt{10} \approx 3.162 \):
- The larger root satisfies \( x = 1 + \sqrt{k + 5} > 4 > 2 \) (valid on \( x > 2 \)).
- The smaller root satisfies \( x = 1 - \sqrt{k + 5} < -2 \) (valid on \( x < -2 \)).
Thus, there are always exactly 2 distinct solutions on the outer branches.
Combining both parts, the equation has \( 2 + 2 = 4 \) distinct real solutions if and only if \( 4 < k < 5 \).