For this problem we can create the following functions for the total cost for ech company like this:
Where x represent the number of miles and Ca, Cb the cost for Company A and B respectively. For this case we can set up equal both costs and we got:
And if we solve for x we got:
And solving for x we got:
And for this case we can conclude that x=300 miles in order to have the same rental costs for both companies