# Optimization: Lagrangian with two functions

• Sep 29th 2013, 04:08 AM
TwoPlusTwo
Optimization: Lagrangian with two functions
Find $y_1(x), y_2(x)$ so that $J$ is minimized.

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

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

$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:

$y_1''=2y_2$

$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 $x$, is given by:

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

Using that property I obtained another equation:

$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!
• Sep 29th 2013, 06:00 PM
topsquark
Re: Optimization: Lagrangian with two functions
Quote:

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

$y_2''=8y_1$

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

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

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

Solve that and let's see what you get.

-Dan
• Sep 30th 2013, 03:23 AM
TwoPlusTwo
Re: Optimization: Lagrangian with two functions
Quote:

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

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

$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 $y_1$, then differentiated twice (and divided by two) to get $y_2$. Using the boundary conditions, I obtained the four constants from a set of four equations. The final solution was:

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

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

where

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

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