Answer:
 
 = - mg (h - hₐ)
 = - mg (h - hₐ)
Step-by-step explanation:
For this exercise we must use the energy work relationship 
 W = ΔEm 
Where work is the work of the friction forces along the plane as the force of friction opposes the movement is always negative 
 W = -fr d 
The energy can be searched for two points of interest, when it is going down, let's use the highest point and the lowest point 
Initial, highest point 
 Em₀ = U = m g and 
Final, lower at maximum spring compression 
 
 = K = ½ m v²
= K = ½ m v² 
Let's replace 
 -fr₁ d₁ = ½ m v² - m g y 
 
We do the same for when the plane bounces and goes up 
Initial, lower 
 Em₂ = K = ½ mv² 
Higher 
 Em₃ = U = m g ya 
 
 -fr2 d2 = mg yₐ - ½ mv²
 
Let's write our system of equations 
 -fr₁ d₁ = ½ m v² - m g y 
 -fr₂ d₂ = mg yₐ - ½ mv² 
Let's add 
 -fr₁d₁ –fr₂d₂ = mg yₐ - mg y 
 
 = mg (yₐ -y)
 = mg (yₐ -y) 
 
 
 = - mg (h - hₐ)
 = - mg (h - hₐ)