Do you usually use the long procedures given in the standard textbooks in calculus or have you tried using some derived formulas like the one given in the link below? Perhaps, you can also try deriving other formulas for solving some other optimization problems and if you have already, may be you can also share your formulas with us.
Article On Minimum Distance Problem