On the right side, both terms contain g, so we can factor it out
T = g(r+vt)
Now, to get g by itself, divide by the things in parentheses
g= T/(r+vt)