$P$ is $(2,1)$ and $A$ and $B$ lie on $X$ axis and $y=x$ respectively such that $PA+PB+AB$ is minimum, then find the co-ordinates of $A$ and $B$.
If we consider $A$ to be $(a,0)$ and $B$ to be $(b,b)$ it would become complicated. Is there any other way?
hint: with this informations we get $$f(a,b)=\sqrt{(a-2)^2+1}+\sqrt{(b-2)^2+(b-1)^2}+\sqrt{(b-a)^2+b^2}$$ can you proceed? $$f_a=1/2\,{\frac {2\,a-4}{\sqrt { \left( a-2 \right) ^{2}+1}}}+1/2\,{\frac {-2\,b+2\,a}{\sqrt { \left( b-a \right) ^{2}+{b}^{2}}}} $$ $$f_b=1/2\,{\frac {4\,b-6}{\sqrt { \left( b-2 \right) ^{2}+ \left( b-1 \right) ^{2}}}}+1/2\,{\frac {4\,b-2\,a}{\sqrt { \left( b-a \right) ^{ 2}+{b}^{2}}}} $$ solve the System $$f_a=0$$ and $$f_b=0$$