Let Q=(0,5)\displaystyle {Q}={\left({0},{5}\right)} and R=(6,10)\displaystyle {R}={\left({6},{10}\right)} be given points in the plane. We want to find the point P=(x,0)\displaystyle {P}={\left({x},{0}\right)} on the x\displaystyle {x}-axis such that the sum of distances PQ+PR\displaystyle {P}{Q}+{P}{R} is as small as possible. (Before proceeding with this problem, draw a picture!)
To solve this problem, we need to minimize the following function of x\displaystyle {x}:
f(x)=\displaystyle {f{{\left({x}\right)}}}=  
over the closed interval [a,b]\displaystyle {\left[{a},{b}\right]} where a=\displaystyle {a}=   and b=\displaystyle {b}=   .
We find that f(x)\displaystyle {f{{\left({x}\right)}}} has only one critical number in the interval at x=\displaystyle {x}=  
where f(x)\displaystyle {f{{\left({x}\right)}}} has value  
Since this is smaller than the values of f(x)\displaystyle {f{{\left({x}\right)}}} at the two endpoints, we conclude that this is the minimal sum of distances.