Snell’s Law

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu
3/8/2012

Below is an illustration of Snell' s Law.

Light is traveling from a point in Medium 1 (e.g. air) to a point in Medium 2 (e.g. water)
Snell’s Law states that the ration ((Subscript[v, 1])/(Subscript[v, 2]))of the velocities equals the corresponding ratio ((sin((Subscript[θ, 1])))/(sin((Subscript[θ, 2])))).  Here θ is the angle between the light beam (blue) and the normal (dashed). According to Fermat, the light chooses the path that minimizes travel time.

The speed of light (Subscript[v, 1]) in Medium 1 is set to 10 units per second, the speed of light (Subscript[v, 2]) in Medium 2 can be varied between 5 and 15 units per second.

(Subscript[v, 1])=10;
Manipulate[Graphics[{{If[
Abs[x-NSolve[D[Sqrt[(3+y)^2+1]/(Subscript[v, 1])+Sqrt[(y-2)^2+1]/(Subscript[v, 2]),y]==0][[1,1,2]]]
<.05,Red,Blue],Thick,Circle[{x,0},.5,{π/2,π/2+ArcTan[3+x]}],Circle[{x,0},.5,{-π/2,-ArcTan[1/(2-x)]}],Line[{{-3,1},{x,0},{2,-1}}]},{Dashed,Line[{{x,-1},{x,1}}]},{Text["Medium 1",{2,.5}],Text["Medium 2",{-3,-.5}]},{AbsolutePointSize[7],Blue,Point[{-3,1}],Point[{2,-1}]}},
Axes->{Automatic,None},Ticks->False,ImageSize->500,PlotLabel->Row[{Round[N[Sqrt[(3+x)^2+1]/(Subscript[v, 1])+Sqrt[(x-2)^2+1]/(Subscript[v, 2])],0.001]," sec"}]],{x,-3,2-.001,0.01},{(Subscript[v, 2]),5,20,1}]

Here are the calculations to determine the desired minimum. 
t(x) is the time the light beam requires to travel from point ((Subscript[x, 1]),(Subscript[y, 1]))  to ((Subscript[x, 2]),(Subscript[y, 2])). The two velocities are denoted by (Subscript[w, 1]) and (Subscript[w, 2]).

t[x_]=Sqrt[y1^2+(x-x1)^2]/(Subscript[w, 1])+Sqrt[y2^2+(x2-x)^2]/(Subscript[w, 2])

Here is the first derivative; note that the first expression below equals ((sin((Subscript[θ, 1])))/(Subscript[w, 1])),  while the expression on the right is ((sin((Subscript[θ, 2])))/(Subscript[w, 2])).

t'[x]

The second derivative looks complicated, but can be algebraically simplified. We can then observe that the second derivative is always positive, so the critical point above yields a relative minimum.

t''[x]

FullSimplify[t''[x]]