A Walk on the road and through the fields.

The situation has been described in class.   It involves a walk partly along a road and partly through fields.  The question is where to leave the road to minimize the time of the walk.

We figured out in class that this leads to the objective function
f[x_]  :=  (x/3) + (1/2) (Sqrt[10 - 6 x + (x^2)])

of the interval 0 ≤ x ≤ 3

0  ≤  x  ≤  
      3

f[x_]  :=  
      (x/3) + (1/2) (Sqrt[10 - 6 x + (x^2)])


Plot[(x/3) + (1/2) (Sqrt[10 - 6 x + (x^2)]), {x, 0, 3},  
      PlotRange ->  {1, 2}]

Together[f'[x]]

Setting f'[x] = 0 will lead to a quadratic equation, which we could solve by hand.  To save some time,  I'm going to let the computer do it.

Solve[f'[x]  ==  0,  x]
N[%]

N[f[0]]
N[f[3]]
f[2.10557]

Solution "by hand"  of  
f'[x] = 0  
would lead to the following quadratic equation.   

(But at some point we squared both sides of our original equation so we could have introduced a spurious additional solution.  In fact the second solution is spurious.

Solve[5 (x^2) - 30 x + 41 == 0, x]
N[%]

You can see from the following plots that the equation f'[x] = 0 has only one solution, not two.

Plot[f[x],  {x,  -10, 10},  
      PlotRange ->  {0,  6}]
Plot[f'[x],  {x,  -10, 10}]