Odd result for the euler_lagrange command

Messages in english

Modérateur : xcasadmin

belanger
Messages : 59
Inscription : jeu. juil. 27, 2017 3:26 pm

Odd result for the euler_lagrange command

Message par belanger » sam. oct. 24, 2020 3:42 pm

Hi All,

The euler_lagrange command gives an odd result when the input is a variable that evaluates to an expression
rather than the expression itself. For example:

>> f := x^2*diff(y(x),x)^2 + y^2

x^2*(diff(y(x),x))^2+y^2

>> euler_lagrange(f)

[-x^2*(diff((y(t))(x),x))^2-(y(t))^2=K_0,2*x^2*diff(diff((y(t))(x),x,1),y(t),1)*diff((y(t))(x),x)+2*y(t)=0]

The t isn't an artifact from a previous command, since these were the first two commands of a session, so I don't know what it doing there.
However, using the expression instead of the variable f gives the correct result:

>> euler_lagrange(x^2*diff(y(x),x)^2 + y^2)

diff(y(x),x,2)=((-2*diff(y(x),x)*x+y(x))/x^2)

Jay

Répondre