# Euler Lagrange exercise

Tags:
1. Feb 21, 2015

### Jillds

1. The problem statement, all variables and given/known data
On very hot days there sometimes can be a mirage seen hovering as you drive. Very close to the ground there is a temperature gradient which makes the refraction index rises with the height. Can we explain the mirage with it? Which unit do you need to extremalise? Writer the Euler-Lagrange equation. This gives a differential equation that you need to solve.

2. Relevant equations
refraction index: $n =\frac{c}{v} \Leftrightarrow \frac{n}{c}=\frac{1}{v}$
Euler-Lagrange equation: $\frac{d}{dt}\frac{\partial L}{\partial \dot{q}}=\frac{\partial L}{\partial q}$
1st integral: $\dot{q} \frac{\partial L}{\partial \dot{q}}-L= constant$
$dl^2=dx^2 + dy^2$
tip given: $n(y) \approx n_0 (1+\alpha y)$

3. The attempt at a solution
Light follows Fermat's principle: not the way of the shortest distance, but shortest time, hence it is time we need to extremalise

$t=\int dt = \int \frac{dl}{dl}dt = \int \frac{dl}{v} = \int \frac{n}{c} dl = \frac{1}{c} \int n(y) \sqrt{dx^2 + dy^2}$

No need to solve this by introducing a third term. The integral can be written in two ways:
1) $ct = \int n(y) \sqrt{1+\frac{dy^2}{dx^2}}dx = \int n(y) \sqrt{1+\dot{y}^2} dx$ with $L= n(y) \sqrt{1+\dot{y}^2}$
2) $ct = \int n(y) \sqrt{1+\frac{dx^2}{dy^2}}dy = \int n(y) \sqrt{1+\dot{x}^2} dy$ with $L= n(y) \sqrt{1+\dot{x}^2}$

1) The first integral leads to an Euler-Lagrange equation that does not equal to 0, because n(y) varies with the height:
$\frac{d}{dx}\frac{\partial L}{\partial \dot{y}}=\frac{\partial L}{\partial y} \neq 0$

So it needs to be reworked as a 1st integral:
$\dot{y} \frac{\partial L}{\partial \dot{y}}-L= c_1$

I haven't tried to solve this DE yet, because this is the hardest way, but it should have the same solution as the second Lagrange.

2) The second integral does lead to an Euler-Lagrange equation that equals 0:
$\frac{d}{dy}\frac{\partial L}{\partial \dot{x}}=\frac{\partial L}{\partial x} = 0$

Hence $\frac{\partial L}{\partial \dot{x}}=c_2$
$c_2 = \frac{n(y) \dot{x}}{\sqrt{\dot{x}^2+1}}$
$\Leftrightarrow c_2^2 = \frac{n^2(y) \dot{x}^2}{\dot{x}^2+1}$
$\Leftrightarrow c_2^2 (\dot{x}^2+1)= n^2(y) \dot{x}^2$
$\Leftrightarrow c_2^2 \dot{x}^2+c_2^2= n^2(y) \dot{x}^2$
$\Leftrightarrow c_2^2= n^2(y) \dot{x}^2 - c_2^2 \dot{x}^2$
$\Leftrightarrow c_2^2= \dot{x}^2 ( n^2(y) - c_2^2)$
$\Leftrightarrow \dot{x}^2 = \frac{c_2^2}{( n^2(y) - c_2^2)}$
$\Leftrightarrow \dot{x} = \frac{c_2}{\sqrt{ n^2(y) - c_2^2}}$
$\Leftrightarrow \frac{dx}{dy} = \frac{c_2}{\sqrt{ n^2(y) - c_2^2}}$
$\Leftrightarrow dx = \frac{c_2}{\sqrt{ n^2(y) - c_2^2}} dy$
$\Leftrightarrow x = c_2 \int \frac{dy}{\sqrt{ n^2(y) - c_2^2}}$
$\Leftrightarrow x = c_2 \int \frac{dy}{\sqrt{ n_0^2(1+\alpha y)^2 - c_2^2}}$

with $n_0(1+\alpha y) = u \Leftrightarrow dy = \frac{du}{n_0 \alpha}$

$\Rightarrow x = \frac{c_2}{n_0 \alpha} \int \frac{du}{\sqrt{ u^2 - c_2^2}}$
$\Leftrightarrow x = \frac{c_2}{n_0 \alpha} \int \frac{du}{\sqrt{ \frac{u^2}{c_2^2} -1 }}\frac{1}{c_2}$
$\Leftrightarrow x = \frac{1}{n_0 \alpha} \int \frac{du}{\sqrt{ \frac{u^2}{c_2^2} -1 }}$

with $\frac{u}{c}=t \Leftrightarrow du=c dt$

$\Rightarrow x = \frac{c_2}{n_0 \alpha} \int \frac{dt}{\sqrt{ t^2 - 1}}$

with $t = sec (v) \Leftrightarrow dt = \frac{tan(v)}{cos(v)}dv$

$\Rightarrow x = \frac{c_2}{n_0 \alpha} \int sec(v) dv$
$\Leftrightarrow x = \frac{c_2}{n_0 \alpha} ln(tan (v) + sec(v))+C$
$\Leftrightarrow x = \frac{c_2}{n_0 \alpha} ln(tan (arcsec(t)) + t)+C$
$\Leftrightarrow x = \frac{c_2}{n_0 \alpha} ln(tan (arcsec(\frac{u}{c})) + \frac{u}{c})+C$
$\Leftrightarrow x = \frac{c_2}{n_0 \alpha} ln(tan (arcsec(\frac{n_0(1+\alpha y)}{c_2})) + \frac{n_0(1+\alpha y)}{c_2})+C$

I'm stuck though on the $tan(arcsec(t))$ and how to simplify that. Also when I plug in $ln(tan(arcsec(x))+x)$ into google to check the graph it doesn't give me the graph that we're given (parabolic). So did I solve this wrong so far? And where did I go wrong?

(ETA: mistake in formula of 1st integral)

Last edited: Feb 21, 2015
2. Feb 21, 2015

### Jillds

I managed to figure out the $tan(arcsec(t))$
$\Leftrightarrow tan(arccos(\frac{1}{t})$

We know the $cos \theta=\frac{1}{t}$
This would mean that the adjacent of a right triangle has value 1 and the hypothenuse is t. Using Pythagoras we can find the opposite of the angle.

$O^2=H^2-A^2 = t^2-1$
$\Leftrightarrow O=\sqrt{t^2-1}$

So the tangens of the angle would be
$tan (\theta)=\frac{O}{A}=\frac{\sqrt{t^2-1}}{t}$
or
$tan (\theta)=\sqrt{1-\frac{1}{t^2}}t$

reworking that in my current solution that would give

$x=\frac{c_2}{n_0\alpha} ln(\frac{c_2\sqrt{n_0^2(1+\alpha y)^2-c_2^2}+n_0^2(1-\alpha y)^2}{c_2 n_0(1+\alpha y)})+C$

3. Feb 21, 2015

### Jillds

But it can all be made simpler considering that $\int \frac{dx}{\sqrt{x^2+a^2}}=arcosh(\frac{x}{a})+C$

Then $x=\frac{c_2}{n_0\alpha} arcosh \frac{n_0(1+\alpha y)}{c_2}+C$
which is the inverse of a cosh function which is the most similar to a parabolic graph. So that would seem to work.