3 months
Let's express the amount of money spent on club A as a function of the number of months
A = 21 + 26m
And do the same thing for club B
B = 42 + 19m
We now want to set the 2 expressions equal to each other.
21 + 26m = 42 + 19m
And solve for m. First subtract 21 from both sides
26m = 21 + 19m
Now subtract 19m from both sides
7m = 21
And divide both sides by 7
m = 3
Therefore after three months, the total cost for each health club will be the same.