Use equation in the form:
[tex]C=mx+b[/tex]Where C is the cost, m is the monthly charge, x is the number of months and b is the joining fee:
Gym A:
[tex]C_A=40x+20[/tex]Gym B:
[tex]C_B=45x[/tex]Find the number of months (x) that it rill take for CA and CB to be equal:
Equal CA and CB:
[tex]\begin{gathered} C_A=C_B \\ \\ 40x+20=45x \end{gathered}[/tex]Use the equation above to find the value of x:
[tex]\begin{gathered} 40x-45x=-20 \\ -5x=-20 \\ x=\frac{-20}{-5} \\ \\ x=4 \end{gathered}[/tex]Then, it will take 4 months for total cost for both gyms to be equal