I have a function dependent on w(x,t) which is integrated in an interval. After integration of this function, I want to apply variation followed by integral by parts. Integral by parts results in to more than one results, if equated with zero. $$\begin{array}{l} U = \int\limits_0^l {{{\left( {\frac{{{\partial ^2}w}}{{\partial {x^2}}}} \right)}^2}dx} \\ \text{Taking variation and equating with 0,}\\ \delta U = \int\limits_0^l {2\,\left( {\frac{{{\partial ^2}w}}{{\partial {x^2}}}} \right)\,\,\delta \left( {\frac{{{\partial ^2}w}}{{\partial {x^2}}}} \right)dx} = 0\\ \delta U = 2\left( {\left( {\frac{{{\partial ^2}w}}{{\partial {x^2}}}} \right)\delta \left( {\frac{{\partial w}}{{\partial x}}} \right)\mathop |\limits_0^l - \left( {\frac{{{\partial ^3}w}}{{\partial {x^3}}}} \right)\delta \left( w \right)\mathop |\limits_0^l + \int\limits_0^l {\left( {\frac{{{\partial ^4}w}}{{\partial {x^4}}}} \right)\,\,\delta \left( w \right)dx} } \right) = 0\\ \text{that gives boundary conditions},\,\left( {\frac{{{\partial ^2}w}}{{\partial {x^2}}}} \right)\delta \left( {\frac{{\partial w}}{{\partial x}}} \right) = \left( {\frac{{{\partial ^3}w}}{{\partial {x^3}}}} \right)\delta w = 0,\,at\,x = 0,\,\,l\\ \text{equation},\,\left( {\frac{{{\partial ^4}w}}{{\partial {x^4}}}} \right) = 0 \end{array}$$
Mathematica codes,
Get["VariationalMethods`"]
dU[x, t] = D[w[x, t], {x, 2}]^2
Taking Variation variationofdU = VariationalD[dU[x, t], w[x, t], {x, t}]
that gives fourth order derivative, 2*Derivative[4, 0][w][x, t]
which is perfect as per the result shown above. This command gives variational derivative of the integral with respect to w[x,t], but irrespective of the limits of the integral but, if I want to get the boundary conditions also (as per shown above) for a definite integral of a function than VariationalD
doesn't give.
Can anyone please tell how to evaluate the boundary conditions which comes from the integral by parts? I want to use this to apply Hamilton's theorem for a larger equation.
I have used Mathematica for solving differential equations and algebric equations but for the advance calculations in mathematica, I am very new. Any help for this problem, I will appreciate. Can anyone please help me how I can get all the equations shown above using Mathematica?