Answer: it will take 6 months for both gyms to cost the same.
Step-by-step explanation:
Let m represent the number of months that it will take for the cost of both gyms be the same.
At one gym, there is a $12 start-up fee, and after that each month, m, at the gym costs $20. This means that the total cost for m months is
12 + 20m
At another gym, each month at the gym costs $22. This means that the total cost for m months is 22m
For both costs to be the same, the number of months would be
12 + 20m = 22m
22m - 20m = 12
2m = 12
m = 12/2 = 6