Let's call the distance to the appointment 'd', and the time of the first travel (going to the appointment) 't'.
Now, we need to use the formula for the distance:
[tex]\text{distance}=\text{average speed }\cdot\text{ time}[/tex]For the first part of the trip, we have the distance 'd', the average speed is 40 mph and the time is 't':
[tex]d=40\cdot t[/tex]Then, for the second part of the trip (return trip), the distance is also 'd', the average speed is 30 mph, and the time is 't + 1/3', because she took 1/3 hour longer than the first trip.
So we have that:
[tex]d=30\cdot(t+\frac{1}{3})=30t+10[/tex]Now, we just need to equate both 'd':
[tex]\begin{gathered} 40t=30t+10 \\ 10t=10 \\ t=1 \end{gathered}[/tex]So the time 't' is 1 hour. Now we can use that to find the distance 'd':
[tex]d=40t=40\cdot1=40[/tex]So the distance to the appointment is 40 miles.