Assuming the spring obeys Hooke's law:
F=kx
Where
F=force
k=spring constant
x= extension
The question implies that alpha and beta is the total length of the spring, rather than the extension. If we define the length of the spring without any weights on it as y, then
We know that
4=k(alpha-y) .......equation (1)
and
5=k(beta-y) .......equation (2)
If we divide the two equations:
5/4=(beta-y)/(alpha-y)
We can expand and solve for y
5(alpha-y)=4(beta-y)
5alpha-5y=4beta-4y
5alpha-4beta=y ..........equation (3)
For the 9N weight, of total length, say z:
9=k(z-y)
If we divide this by equation (2)
9/5=(z-y)/(beta-y)
9beta-9y=5z-5y
9beta-4y=5z
Substitute in for y from equation (3):
9beta-4(5alpha-4beta)=5z
9beta-20alpha+16beta=5z
25beta-20alpha=5z
z=5beta-4alpha