1
$\begingroup$

Commonly, in textbooks, differential of differential increment vanishes, good example is how Euler-Lagrange equations are derived using the differential (from step 2 to step 3 here, you can see d[q(t) + e*eta(t)] becomes d[q(t)] because eta(t) is infinitesimal change). And it makes sense because such small changes are considered negligible, and that is essential to define derivative rules (to see why I recommend this video at 3:00).

I would like to replicate similar behaviour in Mathematica to check correctness of certain derivations I made. Without it vanishing, my expressions will grow and not exlude negligeable terms.

I used the DifferentialD operator to represent differential increment, however Mathematica doesn't seem to replicate such behaviour.

I started with the following

DifferentialD[x + DifferentialD[y]]

I also tried to check if following expression be equal to zero but it wasn't the case.

DifferentialD[DifferentialD[y]]

Could someone more experienced with Mathematica (or symbolic computation in general) comment on that?

EDIT:

It appears that problem of how to handle operations on infinitesimal quantities is more deep than just simple algebra. For reference I'd like to share this thread, it has a lot of good references and explanations.

$\endgroup$
  • 2
    $\begingroup$ The documentation of DifferentialD says "DifferentialD[x] has no built-in meaning." $\endgroup$ – Henrik Schumacher Jun 15 '18 at 20:07
  • 6
    $\begingroup$ There would be much less confusion in this world if people finally reached 20th century mathematics, left this "infinitesimal change" business, and learned what a (Fréchet or Gâteaux) derivative is. Actually, in the source you cite, $\eta$ is not infinitesimal at all. It is just a tangent vector and what is performed there is simply the directional derivative in that direction. $\endgroup$ – Henrik Schumacher Jun 15 '18 at 20:16
  • $\begingroup$ I get what you're saying, @Henrik. Thank you for quick feedback. The source says "little variation η(t), although infinitesimal", which really is confusing. $\endgroup$ – Marek Jun 15 '18 at 22:15
  • 2
    $\begingroup$ The infinitesimal part is $\epsilon$, not $\eta$. $\endgroup$ – Michael E2 Jun 16 '18 at 1:43
4
$\begingroup$

I don't really approve of your intention but anyway. You can use

DifferentialD[x_ + y_] := DifferentialD[x] + DifferentialD[y]
DifferentialD[DifferentialD[x_]] := 0

With this, DifferentialD[x + DifferentialD[y]] evaluates to DifferentialD[x], as required.

For completeness,

DifferentialD[x_^n_] := n x^(n - 1) DifferentialD[x]
DifferentialD[x_ y_] := x DifferentialD[y] + y DifferentialD[x]
$\endgroup$
  • $\begingroup$ Note: there is a built-in that does almost what OP wants, Dt, but one has to unprotect it and make it nilpotent, Dt[Dt[x_]] := 0. $\endgroup$ – AccidentalFourierTransform Jun 15 '18 at 21:13
  • $\begingroup$ Are you aware that this would make all functions linear? $\endgroup$ – Henrik Schumacher Jun 15 '18 at 21:59
  • $\begingroup$ @AccidentalFourierTransform since you don't approve this initiative, could you provide some examples of derivations that don't require this? For instance in the example I provided with Euler-Lagrange equations, how could that step be skipped? Because I agree with you and Henrik that this formalism is really ugly and I would love to learn a better way. $\endgroup$ – Marek Jun 15 '18 at 22:19
  • 2
    $\begingroup$ @Marek For E-L, you need Variational Methods. $\endgroup$ – AccidentalFourierTransform Jun 15 '18 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.