First is to make equations for both sides.
Let x be the number of the miles.
a be the charge of the first company
b be the charge of the second
a=$35+$0.25(x), b=$40+$0.20(x) .
then a=b
Substitute the equations
$35+$0.25(x)=$40+$0.20(x)
$0.25x - $0.20x = $40 - $35
$0.05x = $5
x= $5/$0.05 , cancel out the unit.
x= 100
To justify substitute x to both the equations a and b.
a= 35 + 0.25(x)
a= 35 + 0.25(100)
a= 35 + 25
a= $60
b= 40 + 0.20(x)
b= 40 + 0.20(100)
b= 40 + 20
b= 60
a=b
60=60.