# How to find Euler equation of complex function by the textbook definition

In the help document, we know that EulerEquations[y[x] Sqrt[1 + Derivative[1][y][x]^2], y[x], x] can solve the following Euler equation of equation :$$∫_{x_{\min}}^{x_{\max}}y(x)\sqrt{1+y'(x)^{2}} dx$$

But how can we solve the Euler equation in the following mixed case with integral and others terms by using MMA?

The result of the variation of the above functional in the textbook is :

Using the boundary conditions $${w(0)=0,w(L)=0,w'(0)=0}$$, we can reduce the above results to:

I did this, but it turned out to be obviously wrong:

EulerEquations[
Integrate[(1/2 \[DoubleStruckCapitalE]*\[DoubleStruckCapitalJ]*
w''[x] - q*w[x]), {x, 0, L}] + M*w'[L], w[x], x]


I need to find the first derivative of a functional according to the above textbook definition.

And the results in this link don't meet my needs.

• I think you may need MMA's code to find the first derivative of functional by definition. I'm also interested in this problem. – user69323 Feb 17 at 5:58

First, as much as I see from documentation the function EulerEquations takes the Lagrangian as the argument, rather than the action. Therefore, there should be no Integratestatement. Just the expression staying under the integral. Second, EulerEquations do not treat the boundary terms such as M*w'[L]. And as a minor note, you have forgotten to square the w''[x] term. Like this it is
Needs["VariationalMethods"];
`
• Thank you very much for your help. I want to know if there is any way to achieve the $\delta$ result form in the textbook. – A little mouse on the pampas Feb 17 at 23:09