✔ 最佳答案
The "compression" in the question refers to the final compression of the spring when the ball comes to rest. Under such situation, the weight of the ball is balanced by the spring force, i.e.
mg = kx
where m is the mass of the ball, g is the acceleration due to gravity, k is th espring constant, and x is the final compression.
Clearly, x = mg/k which is independent of the height h.
Your equation: mg + ma = ke doesn't make any sense at all. It is because a and e are both time dependent.