I'm trying to figure out how to get the point x = 3 :
What's given here are the points S and G .
(Assuming the 2 angles are equal)

Apparently, we can assume that the ball does not bounce off the x-axis. Instead, we can change the target with respect to the symmetrical point on the x-axis so that we can now look at the intersection of the x-axis and the line connecting the current and target point.
The Formula to get x=3 is below :
$$\frac{S_x.G_y + G_x.S_y}{S_y+G_y}$$
Is there any explanation for this formula ?

If $G = (G_x, G_y)$, then $G' = (G_x, ??)$.
Next, can you use two-point form to write the equation of SG'?
$ P(P_x, 0)$ is a point on SG'.
Putting the above together with S = (1, 1) and G=(7,2) , you will get $P_x = 3$.