# Use of variational operator, 𝛿 in Mathematica

I am working in Hamilton's principle. Part of deriving the equation of motion is to use the delta operator (𝛿) which can be operated just like a differential operator. It is not the function VariationalD in package VariationalMethods.

A post was posted regarding the same subject but it seems that who asked the question found the answer somewhere else. The previous question is here.

Example on the equation is:

T= 0.5 Mu'^2

applying the delta operator

𝛿T=M u' 𝛿 u'

I need to find the first and second variation of this function w.r.t the dependent variable.

regards

Indeed, VariationalD does perform integration by parts which might be unwanted.

For this simple univariat case, one can hack together a quick function myVariationalD:

Clear[δ, myVariationalD]
myVariationalD[expr_, f_[x_]] := Module[{maxDerivative},
maxDerivative = Max @ Cases[expr, Derivative[m_][f][x] :> m, Infinity];
D[expr, f[x]] δ[f[x]] +
Sum[D[expr, Derivative[m][f][x]] δ[Derivative[m][f][x]], {m,
1, maxDerivative}]
]


The example you have given can then be computed as

expr = 1/2 \[DoubleStruckCapitalM] u'[t]^2;
myVariationalD[expr, u[t]]
(* \[DoubleStruckCapitalM] δ[u'[t]] u'[t] *)

• Thank you Natas, What about below equation: >> T = 0.5 M D[u[t], t]^2 >> [Delta]T = D[T /. {u -> u + s [Delta]u}, s] /. s -> 0 Nov 13 '20 at 20:06
• @aymanzayed Sorry, but I don't quite understand what you are asking. Perhaps you can modify your question and explain in detail the expected output for a given input and I can then edit my answer? Nov 14 '20 at 7:53