Write an expression for both companies
m stands for the number of months
⇒ Company A has a $20 signing fee and charges $40 monthly. Signing fee will be the constant, because it's not influenced by the number of months. 40 will be the coefficient of m. The expression will be 20 + 40m
⇒ Company B has no signing fee and charges $45 monthly. 45 will be the coefficient of m, because the total charge is influenced by the number of months. The expression will be 45m
Determine the number of months
For both costs being equal, write an equation that equalizes both expression
45m = 20 + 40m
solve for m
45m - 40m = 20
5m = 20
m = 20/5
m = 4
For both costs being equal, it needs 4 months