w = the distance West of the cabin on the river where the horse waters.

Dt = distance traveled while thirsty [at 10km/hr, or 6 min/km]

Dw = distance traveled while watered [at 12 km/hr, or 5 min/km]

Return time is

[1] Tr = [6 Dt + 15 + 5 Dw] minutes

**Minimize Tr with respect to w**.

[2] Dt = [(8-w)

^{2} + 6

^{2}]

^{.5} - on the way to the river

[3] Dw = [w

^{2} + 10

^{2}]

^{.5} - from the river back to the cabin

It's clear that going straight north to the river [w=8] and going straight south from the river to the cabin [w=0] take longer than needed.

So somewhere between 8 and 0 w has a value w

_{min} that minimizes Tr.

The roughest approximation for w

_{min} is 4 km [halfway], but that's too low because PT starts north of the house

If the speeds to and from the river were the same, w

_{min} would simply be

**5** km - the route of shortest

**distance**.

But since it's [slightly] better to travel a little farther watered, w

_{min} will be somewhat greater than [west of] 5.

Here's what happens

- plug [2] and [3] into [1] and differentiate with respect to w.

Use the chain rule for differentiating: if f(x) = f[g(x)], first set u=g(x); then df/dx = df/du x dy/dx. - Set dTr/dw = 0
- Solve for w, getting
**w**_{min} = **5.40889**... km west of cabin - evaluate [1]-[3] to get
**Tr**(w_{min}) = **111.0589** ... minutes