# Thread: Optimization: Lagrangian with two functions

1. ## Optimization: Lagrangian with two functions

Find $\displaystyle y_1(x), y_2(x)$ so that $\displaystyle J$ is minimized.

$\displaystyle J(y_1,y_2)=\int_0^\frac{\pi}{4}(4y_1^2+y_2^2+y_1'y _2')dx$

$\displaystyle y_1(0)=1, y_2(0)=0$

$\displaystyle y_1(\frac{\pi}{4})=0, y_2(\frac{\pi}{4})=1$

My work so far

I set up the Euler-Lagrange equation for each of the functions, giving me a set of second order differential equations:

$\displaystyle y_1''=2y_2$

$\displaystyle y_2''=8y_1$

I tried putting the equations in matrix form and using Wolfram to calculate the eigenvalues and eigenvectors. But solving a 4x4 system with complex eigenvalues seems to be beyond the scope of my calculus of variations course. I suspect there is a simpler way to do it, something that can be done by hand.

According to my textbook, a first integral of a Lagrangian of several functions, not explicitly dependent on $\displaystyle x$, is given by:

$\displaystyle L-\sum_{i=0}^{n}y_i'L_{y_{i}^{'}} = C$

Using that property I obtained another equation:

$\displaystyle 4y_1^2+y_2^2-y_{1}^{'}y_{2}^{'}=C$

I'm not sure what to do with this though. So basically I'm stuck.

Any help is appreciated!

2. ## Re: Optimization: Lagrangian with two functions

Originally Posted by TwoPlusTwo
$\displaystyle y_1''=2y_2$

$\displaystyle y_2''=8y_1$
I haven't checked the boundary conditions, but from the first equation we get:
$\displaystyle y_2 = \frac{1}{2}y_1''$

So
$\displaystyle y_2'' = \frac{1}{2} y_1^{( \text{iv} )}$

$\displaystyle y_2'' = \frac{1}{2} y_1^{( \text{iv} )} = 8y_1$

Solve that and let's see what you get.

-Dan

3. ## Re: Optimization: Lagrangian with two functions

Originally Posted by topsquark
I haven't checked the boundary conditions, but from the first equation we get:
$\displaystyle y_2 = \frac{1}{2}y_1''$

So
$\displaystyle y_2'' = \frac{1}{2} y_1^{( \text{iv} )}$

$\displaystyle y_2'' = \frac{1}{2} y_1^{( \text{iv} )} = 8y_1$

Solve that and let's see what you get.

-Dan
Great, thanks! That was just what I needed.

I first solved for $\displaystyle y_1$, then differentiated twice (and divided by two) to get $\displaystyle y_2$. Using the boundary conditions, I obtained the four constants from a set of four equations. The final solution was:

$\displaystyle y_{1}(x)=c_{1}e^{2x}+c_{2}e^{-2x}+c_{3}\sin(2x)+c_{4}\cos(2x)$

$\displaystyle y_{2}(x)=2c_{1}e^{2x}+2c_{2}e^{-2x}-2c_{3}\sin(2x)-2c_{4}\cos(2x)$,

where

$\displaystyle c_1=0.1403$
$\displaystyle c_2=0.3596$
$\displaystyle c_3=0.25$
$\displaystyle c_4=0.5$

I still used Wolfram to solve the first system, but the solution was much shorter and easier to work with