Odd result for the euler_lagrange command

Messages in english

Modérateur : xcasadmin

Messages : 52
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


>> euler_lagrange(f)


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)