Pumping iron: 10x+90=0
Fit for life: 15x+50=0
Set them equal to each other. 10x+90=15x+50. Solve for x. Subtract 50 from both sides, get 10x+40=15x, then subtract 10x from both sides, getting 40=5x. Divide 5 from both sides to isolate x, x=8. After 8 months the two gyms will cost the same.