The gyms can be represented by these equations, with x for months. 40x+55= 30x+125. Combine like terms. First, subtract 30x from both sides, and you get 10x+55=125. Subtract 55 next. You now have 10x=70. Divide by 10, and you get x=7. It will take 7 months for them to be the same. To find the cost, you can plug in x. 40(7)+55=335. 30(7)+125=335. The cost is $335.