Question about Fermat's principle Why when deriving the law of reflection from Fermat's principle of least time do I set $dL/dx = 0$? I am a 12 grade student with a little notions of maxima and mimima in one variable calculus.
 A: Let look at this problem(1) in the more general case of a particle moving with constant speed $\:\upsilon$ ($c\:$ in case of light) : to find the path with the least travel time from point $\:\rm{A}\:$ to point $\:\rm{B}\:$ through one touch (point $\:\rm{C}$) on a plane surface (mirror in case of light) as shown in Figure 01.

Now, choose at random a point $\:\rm{C}\:$ on the mirror and let the path $\:\rm{ACB}\:$. For the total time through the point $\:\rm{C}\:$ we have
\begin{equation}
t=t_{\alpha}+t_{\beta}=\dfrac{L_{\alpha}+L_{\beta}}{\upsilon}=\dfrac{L}{\upsilon}
\tag{01}
\end{equation}
So, the path of least time is the path of least length. 
Let see how this total time, that is the total length, is changed if we displace the point $\:\rm{C}\:$ to the right by $\:\Delta x\:$ at point $\:\rm{D}$, see Figure 01. For infinitesimally small displacement $\:\mathrm{CD}=\Delta x\:$ you can do the following approximations : 
\begin{equation}
\mathrm{AF}\approx \mathrm{AC}=L_{\alpha}\,,\quad  \alpha'\approx \alpha \,,\quad\mathrm{BE}\approx \mathrm{BD}=L_{\beta}\,,\quad \beta'\approx \beta 
\tag{02}
\end{equation}
The new total time and length are 
\begin{equation}
t'=t'_{\alpha}+t'_{\beta}=\dfrac{L'_{\alpha}+L'_{\beta}}{\upsilon}=\dfrac{L'}{\upsilon}
\tag{03}
\end{equation}
so
\begin{equation}
\Delta t=t'-t=\left(t'_{\alpha}+t'_{\beta}\vphantom{\frac12}\right)-\left(t_{\alpha}+t_{\beta}\vphantom{\frac12}\right)=\dfrac{\left(L'_{\alpha}+L'_{\beta}\vphantom{\dfrac12}\right)-\left(L_{\alpha}+L_{\beta}\vphantom{\dfrac12}\right)}{\upsilon}=\dfrac{\Delta L}{\upsilon}
\tag{04}
\end{equation}
From the detail shown in Figure 02
\begin{equation}
\Delta L=\Delta L_{\alpha}-\Delta L_{\beta}=\Delta x\left(\sin\alpha-\sin\beta\right)
\tag{05}
\end{equation}
that is
\begin{equation}
\boxed{\color{blue}{\:\Delta L=\Delta x\left(\sin\alpha-\sin\beta\right)\:\vphantom{\frac12}}}
\tag{06}
\end{equation}
From equation (06) we conclude that :


*

*If $\:\color{blue}{\Delta L>0}\:$ then the displacement of point $\:\rm{C}\:$  by $\:\Delta x >0\:$ (that is to the right) gives greater lengths or times, so we must look for smaller lengths by displacements $\:\Delta x <0\:$ (that is to the left).

*If $\:\color{blue}{\Delta L<0}\:$ then the displacement of point $\:\rm{C}\:$  by $\:\Delta x >0\:$ (that is to the right) gives smaller lengths or times, so we must continue displacements to the right in order to minimize the total length.


So we conclude that to minimize the total length, that is the total time, we must reach a condition such that, either moving to the right or to the left, the rate of change of length $\:\Delta L\:$ per displace- ment unit $\:\Delta x\:$ to be infinitesimally zero
\begin{equation}
\bbox [0.5mm, border: 0.8mm solid  blue;]{
\bbox [2mm, border: 0.5mm solid red;]{\:\dfrac{\Delta L}{\Delta x}=\sin\alpha-\sin\beta=0\:\vphantom{\tfrac12^{\tfrac12}_{\tfrac12}}}}
\tag{07}
\end{equation}
deriving the law of reflection : $\:\sin\alpha=\sin\beta\:$.
Equation (07) expressed with differentials is
\begin{equation}
\boxed{\color{blue}{\:\dfrac{\mathrm{d} L}{\mathrm{d} x}=0\:\vphantom{\dfrac12^{\tfrac12}_{\tfrac12}}}}
\tag{08}
\end{equation}


Differential Calculus



Geometry


(1)
You'll find a similar problem to derive the Snell's Law of Refraction without differential calculus (due to Feynman) in my answer therein :Why one should follow Snell's law for shortest time?.

A: dL/dx means the rate at which the length (L) is changing as the position of the point of reflection (x) changes. To apply Fermat's principle you want to minimise L (Since the speed of light is constant, to minimise time you must minimise distance.)
Now imagine drawing a graph. Put x on the horizontal axis and L on the vertical axis. For any value of x you can work out, and plot a value of L. The graph looks roughly like a letter "U", since at a value of x in the middle, the value of L is minimised. The gradient at the minimum point is zero.
For small values of x, increasing x causes L to become smaller, so for small values of x dL/dx is negative. For larger values of x, increasing x causes L to increase, dL/dx is positive.  At the minimum point dL/dx changes from positive to negative, so at the minimum point dL/dx is equal to zero.
You can therefore find the value of x by calculating an expression for dL/dx and then solving dL/dx = 0.
