To reach his girl friend as fast as possible, he must take least time to travel the distance between him and his girl friend.

The total time taken by him is given by

T = sqrt(10^2 + x^2)/V1 + sqrt[10^2 + ( 20 - x)^2]/V2.

To make the time least dT/dx must be zero.

0 = x/v1*sqrt((10^2 + x^2) - (20-x)/V2*sqrt[10^2 + ( 20 - x)^2]

Or

sin(i)/v1 = sin(b)/v2.