Answer :
[tex]2g-m=5-gh\ \ \ \ |add\ "m"\ and\ "gh"\ to\ both\ sides\\\\2g+gh=5+m\\\\g(2+h)=5+m\ \ \ \ |divide\ both\ sides\ by\ (2+h)\\\\\boxed{g=\frac{5+m}{2+h}}[/tex]
[tex] 2g-m=5-gh\\
2g+gh=m+5\\
g(2+h)=m+5\\
g=\frac{m+5}{h+2}\\\\
h\not=-2
[/tex]