So firstly, multiply both sides by 5/7 (reciprocal of 7/5): [tex] \frac{5}{7}g=p-45 [/tex]
Next, add both sides by 45 and your answer will be: [tex] \frac{5}{7}g+45=p [/tex]
[tex] \frac{7}{5}(p-45)=g \implies \\ p-45 =\frac{5}{7}g= \implies\\ p=\frac{5}{7}g+45 [/tex]