Final answer:
To find when the costs for both gyms are equal, we form equations for each gym's costs and solve for m, which represents the number of months. After setting up the equations and simplifying, we find that it will take 4 months for the costs to be equal.
Step-by-step explanation:
We need to determine when the total cost of joining and maintaining a membership at Gym A is equal to the cost of Gym B. Let's denote the number of months as m.
For Gym A, the total cost is the joining fee plus the monthly charge times the number of months: $20 + $40m.
For Gym B, there is no joining fee, so the total cost is simply the monthly charge times the number of months: $45m.
To find out when they equal each other, we set the two equations equal and solve for m:
Simplifying this equation, we subtract $40m from both sides to get:
Dividing both sides by $5, we determine the number of months:
So it will take 4 months for the total cost of both gyms to be equal.