# Find minimum distance

I came across this problem in a maths exam. I solved this by taking that a light ray passes in such a way that it takes least path. But as this was a maths exam, i was wondering if it can be solved using maths?

Let $A=(0,1)$ and $B = (1,1)$ in the plane $\mathbb{R}^{2}$. Determine the length of the shortest path from A to B consisting of the line segments AP; PQ and QB, where P varies on the x-axis between the points $(0, 0)$ and $(1, 0)$ and Q varies on the line $y = 3$ between the points $(0, 3)$ and $(1, 3)$

-
The reflection argument is mathematics, not Physics. One can set it up as a two variable minimization problem, then Lagrange multipliers, but that is a lot uglier. –  André Nicolas Jan 28 '13 at 18:04
@Phani Raj I noticed that you've accepted only one answer out of sete questions you've asked. If you get a satisfying answer to a question, you should accept your favorite answer. –  Git Gud Jan 28 '13 at 20:52