# Euler-Lagrange Equations

1. Nov 14, 2013

### ~Sam~

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

Compute the Euler-Lagrange for:

∫y(y')2+y2sinx dx

2. Relevant equations

$\frac{∂L}{∂y}$-$\frac{d}{dx}$ ($\frac{∂L}{∂y'}$)

3. The attempt at a solution
Usual computation by hand gives me y'2+2ysin(x) - 2yy'', but Mathematica says it's -y'2-2yy''. Am I doing something wrong?

2. Nov 14, 2013

### Ray Vickson

I get $L_y - D_x L_{y'} = 2 y \sin(x) - y'^2 - 2 y y''$.

3. Nov 14, 2013

### ~Sam~

Hmmm I looked it over again and I get y'2+2ysin(x)-2(yy''+y'2)
For the first part I get: y'2+2ysinx
Second partial: 2yy'
Then derivative of thatis : 2(yy''+y'2)

Ahh so it's the same as you got ty. Why there is no sin in mathematica solution T.T

Last edited: Nov 14, 2013
4. Nov 15, 2013

### Ray Vickson

I don't use or have access to Mathematica (I use Maple instead), so I have no idea what instructions you entered and what Mathematica did with them.

5. Nov 15, 2013

### ~Sam~

Regardless, I assume that's 2ysin(x)−y′2−2yy′ correct Euler-Lagrange then?

6. Nov 15, 2013

Yes it is.