# Optics/Fermat's Principle

## The PrincipleEdit

Fermat's Principle, also known as "The Principle of Least Time" states that:

"Light travels through the path in which it can reach the destination in least time".

It is a fundamental law of optics from which the other laws of geometrical optics can be derived.

## Derivation for Law of ReflectionEdit

The derivation of Law of Reflection using Fermat's principle is straightforward. The Law of Reflection can be derived using elementary calculus and trigonometry. The generalization of the Law of Reflection is Snell's law, which is derived below using the same principle.

The medium that light travels through doesn't change. In order to minimize the time for light travel between two points, we should minimize the path taken.

θi = θr.
the angle of incidence equals the angle of reflection

1. Total path length of the light is given by

$L=d_1+d_2\,$

2. Using Pythagorean theorem from Euclidean Geometry we see that

$d_1=\sqrt{x^2 + a^2}\,$ and $d_2=\sqrt{(l-x)^2 + b^2}\,$

3. When we substitute both values of d1 and d2 for above, we get

$L=\sqrt{x^2 + a^2} + \sqrt{(l-x)^2 + b^2}$

4. In order to minimize the path traveled by light, we take the first derivative of L with respect to x.

$\frac{dL}{dx}=\frac{x}{\sqrt{x^2 + a^2}} + \frac{-(l-x)}{\sqrt{(l-x)^2 + b^2}}=0$

5. Set both sides equal to each other.

$\frac{x}{\sqrt{x^2 + a^2}} = \frac{(l-x)}{\sqrt{(l-x)^2 + b^2}}$

6. We can now tell that the left side is nothing but $\sin\theta_i$ and the right side $\sin\theta_r$ means

$\sin\theta_i=\sin\theta_r \!\$

7. Taking the inverse sine of both sides we see that the angle of incidence equals the angle of reflection

$\theta_i=\theta_r \!\$

## Derivation for Snell's LawEdit

The derivation of Snell's Law using Fermat's Principle is straightforward. Snell's Law can be derived using elementary calculus and trigonometry. Snell's Law is the generalization of the above in that it does not require the medium to be the same everywhere.

Snell's law relates n1, θ1 and n2, θ2.

To mark the speed of light in different media refractive indices named n1 and n2 are used.

$v_1=\frac{c}{n_1} \!\$
$v_2=\frac{c}{n_2}$

Here $c$ is the speed of light in a vacuum and $n_1,n_2 \ge 1 \,$ because all materials slow down light as it travels through them.

1. Time for the trip equals distance traveled divided by the speed.

$T=\frac{d_1}{v_1}+\frac{d_2}{v_2}$

2. Using the Pythagorean theorem from Euclidean Geometry we see that

$\frac{d_1}{v_1}=\frac{\sqrt{x^2 + a^2}}{v_1}\,$ and $\frac{d_2}{v_2}=\frac{\sqrt{b^2 + (l-x)^2}}{v_2}\,$

3. Substituting this result into equation (1) we get

$T=\frac{\sqrt{x^2 + a^2}}{v_1} + \frac{\sqrt{b^2 + (l-x)^2}}{v_2}$

4. To minimize the transit time, we take the derivative with respect to the variable $x$ and set it equal to zero:

$\frac{dT}{dx}=\frac{x}{v_1\sqrt{x^2 + a^2}} + \frac{-(l-x)}{v_2\sqrt{(l-x)^2 + b^2}}=0$

5. After careful examination the above equation we see that it is nothing but

$\frac{dT}{dx}=\frac{\sin\theta_1}{v_1} - \frac{\sin\theta_2}{v_2}=0$

$\frac{\sin\theta_1}{v_1}=\frac{\sin\theta_2}{v_2}$

7. Substituting $\frac{n_1}{c}$ for $\frac{1}{v_1}$ and $\frac{n_2}{c}$ for $\frac{1}{v_2}$ we get

$\frac{n_1}{c}\sin\theta_1=\frac{n_2}{c}\sin\theta_2$

8. Multiplying through by $c$ gives us our result

$n_1\sin\theta_1=n_2\sin\theta_2 \!\$