Using algebra and calculus i need to solve this written question for x City a is separated by a 2km wide river and are located as shown in Figure 1 (not drawn to scale). A road is to be built between city A to B that crosses a bridge straight across the river. 
Use the Sign Test to determine the type of stationary point 
Test to see if you have a minimum

If you want to do with algebra, $A$ being defined as the origin, let us define two points $C(x,9)$ and $D(x,11)$. So, the distance between $A$ and $C$ is given by $$d_{AC}=\sqrt {(x-0)^2+(9-0)^2}=\sqrt {x^2+81}$$ The distance between $D$ and $B$ is given by $$d_{DB}=\sqrt {(17-x)^2+(14-11)^2}=\sqrt {x^2-34x+298}$$ So taking into account the fact tht $d_{CD}=2$, the total distance from $A$ to $B$ is $$d_{AB}=\sqrt {x^2+81}+2+\sqrt {x^2-34x+298}$$ what we want to be minimum. So, compute the derivative (it will contain radicals to be removed by proper rearrangement and squaring; this will finally let you with a quadratic equation $$-72 x^2+2754 x-23409=0$$ the roots of which being $x=\frac{51}{4}$ and $x=\frac{51}{2}$. The latest must be discarded since larger than $17$. So, the solution is $x=\frac{51}{4}$; for this value of $x$, the distance between $A$ and $B$ is then $2+\sqrt{433}=22.81$ km.
Computing the second derivative at  $x=\frac{51}{4}$ gives a value of $\frac{768}{433 \sqrt{433}}$ which is positive, then the solution corresponds to a minimum.
If you look at the variation of $d_{AB}$ as a function of $x$, you should notice that the largest distance would correspond to $x=0$ for which $d_{AB}=11+\sqrt{298}=28.26$ km.  
You could also notice that, flying, the shortest distance batween $A$ and $B$ is $\sqrt {485} =22.02$ km.
