k = spring constant of the spring = 15 N/m
x₀ = initial position of the spring = 0.3 m
x = final position of the spring = 0.4 m
Δx = stretch in the spring
stretch in the spring is given as
Δx = x - x₀
Δx = 0.4 - 0.3
Δx = 0.1 m
the spring force balances the weight
hence
F = force by the weight
using equilibrium of force in vertical direction
force by weight = spring force
F = k Δx
inserting the values
F = 15 x 0.1
F = 1.5 N
the force by weight is also known as force of gravity.