Daniel B. answered 12/06/22
A retired computer professional to teach math, physics
This is an example of conservation of energy.
The spring energy before the release gets converted to potential energy
when the ball reaches maximum height.
Let
m = 0.15 kg me the mass of the ball,
d = 0.085 m be the compression of the spring,
k = 124 N/m be the spring constant,
g = 9.81 m/s² be gravitational acceleration,
h (to be computed) be the ball's maximum height above the original position.
First we simplify the problem by eliminating kinetic energy.
The statement of the problem does not say so explicitly, but I assume that
the ball is stationary before the release.
That makes the ball's kinetic energy zero before the release.
And it is also zero when the ball reaches the maximum height.
So kinetic energy is not involved in the energy exchange.
Now let's discuss potential gravitational energy.
That is always defined with respect to some (arbitrarily chosen) base level.
Let's chose the ball's original position as the base level.
That makes the initial potential energy 0, and the final potential energy
mgh
Now let's discuss the spring energy.
Before the release the spring stores energy
kd²/2
Afterward the spring can be assumed to return to its equilibrium position with zero energy.
The result is that we have only two non-zero energy levels:
the initial spring energy, and the final potential energy of the ball.
By conservation of energy
kd²/2 = mgh
From that
h = kd²/2mg
Substituting actual numbers
h = 124×0.085²/(2×0.15×9.81) ≈ 0.3 m