If you're solving for g then move all terms to the left side and set equal to zero. Then set each factor equal to zero.
And your answer becomes

If you're solving for r then then move all terms to the left side and set equal to zero. Then set each factor equal to zero and your answer is
