I think that's a good way to do it and I think you can make a system of equations in two variables and (and ):

If:

then:

(1) and (2)

If we reform equation (2):

If you substitute this given in (1) then you've an equation in one variable and afterwards you can find .