# Classical Optics / Lagrange multipliers

1. Jan 31, 2014

### eutectic

1. The problem statement, all variables and given/known data

A ray of light enters a glass block of refractive index n and thickness d with angle of incidence θ1. Part of the ray refracts at some angle θ2 such that Snell's law is obeyed, and the rest undergoes specular reflection. The refracted ray reflects off the bottom of the block and then refracts back out. How should θ1 be chosen to maximize the perpendicular distance x between the ray which reflects off the surface, and the ray which reflects off the bottom of the block and refracts back into the atmosphere?

This problem seems a natural fit for Lagrange multipliers, but I am open to other approaches.

2. Relevant equations

If we let x(θ12) be the objective function and sin(θ1) = n sin(θ2) the constraint, then we get

∇f(θ12,λ) = 0, where f(θ12,λ) = x(θ12) - λ(sin(θ1) - n sin(θ2))

3. The attempt at a solution

I derived x to be equal to d tan(θ2) / sin(θ1), giving a final answer of θ1 = arsin(sqrt(n2-1)), but this does not seem physically reasonable. Can anyone spot where I went wrong?

2. Jan 31, 2014

### ehild

It is not sure that you get a local maximum. Drawing a picture, you can express the distance between the rays with simple geometry and get the maximum with inspection.

ehild

3. Feb 2, 2014

### eutectic

I solved it!

It turns out that I had my equation for x wrong. If we let u = 2d tan(θ2) denote the distance between the point where the ray enters the block and the point where it exits, and we take the entry point to be the origin, then the first reflected ray has equation y = x*tan(90-θ1), and the ray emerging from the block has equation y = (x - u)tan(90-θ1).

The perpendicular distance (x) between these lines is then u tan(90-θ1) / sqrt(1+tan2(90-θ1)) = 2 d tan(θ2) cos(θ1), rather than my original answer of d tan(θ2) / sin(θ1). This gives us the lagrange equation f(θ1,θ2,λ) = 2 d tan(θ2) cos(θ1) - λ (sin(θ1) - n sin(θ2)).

Taking partial derivatives, we get -2d sin(θ1)tan(θ2) + λ cos(θ1) = 0, and 2d cos(θ1)sec22) - λn cos(θ2) = 0.

Dividing through and cancelling gives us n cos22)sin(θ1)sin(θ2) = cos21).

Applying the relations sin(θ2) = sin(θ1) / n and sin2(x) + cos2(x) = 1 reduces this to n (1 - (sin(θ1)/n)2) * sin21) / n = 1 - sin21).

This simplifies down to sin41) + n2(1-2 sin21)) = 0.

Finally, we apply the quadratic equation formula.

θ1 = arsin(sqrt(n2 - sqrt(n4 - n2)))

4. Feb 3, 2014

### ehild

It is correct, good job! But why was the Lagrange multipliers method needed? It did not make the calculations easier.

Turn to θ2 as variable,

$$\cos\theta_1=\sqrt{1-n^2\sin(\theta_2)^2}$$

$$f=2d\tan(\theta_2)\sqrt{1-n^2\sin(\theta_2)^2}$$

Take the derivative with respect to θ2: you get maximum distance at $$\sin^2\theta_2=1-\sqrt{1-1/n^2}$$ that is, when $$\sin^2(\theta_1)=n^2\sin^2\theta_2=n^2-\sqrt{n^4-n^2}$$

ehild

5. Feb 3, 2014

### Ray Vickson

Your expressions are written incorrectly, and I am concerned that you may not even know why they are incorrect. When you write things like $\tan(90-\theta)$ you are using degrees to measure angles. If you do that, all the usual formulas for derivatives fail, and need to be modified. So, if you want to use the standard differentiation formulas you need to measure angles in radians, hence write things like $\tan(\pi/2 - \theta)$, etc.

6. Feb 3, 2014

### eutectic

Yes, I am aware of the distinction between radians and degrees. I doubt that this is likely to cause anyone much confusion.