With any equation you are allowed to take the logarithm of both sides so 5^c=125 now take the logarithm base 5 to both sides giving. log5(5^c)=log5(125), using the rule log(a^b)=a*log(b) you get c log5(5)=log5(125), since log5(5)=1 c=log5(125)
It would be $390 for the 4 hours and the cleaning fees. And the slope would be -13 if you are going from 12 to 7 but would be 13 if you are going from 7 to 12...