2
$\begingroup$

I'm trying to calculate the total derivative of functions that have constants. For example, I know that if I calculate the total derivative of $\chi e^{\phi}$, using

Dt[χ*E^φ]

I get:

E^φ χ Dt[χ] + E^φ Dt[χ]

(in latex code is $e^{\phi} \chi Dt[\phi] + e^{\phi} Dt[\chi]$). I'm interested in applying it to cases where there is a constant and still having the Dt[ ]. For example, when I want to calculate the total derivative of $K \chi e^{\phi} $ where $K$ is a constant, it is

Dt[B*χ*E^φ, Constants -> B]
B E^φ χ Dt[φ], Constants -> {B}] + B E^φ Dt[χ, Constants -> {B}]

However, I would like to obtain Dt[\phi] without "Constants -> {B}" since when applying it in more complex expressions, I could factor $Dt[φ]$ in terms that do not have B but not here because it contains the constant $B$ information. Could anyone guide me or give me any suggestions? Maybe it's simpler than I think

$\endgroup$
2
  • 1
    $\begingroup$ btw, your code uses Dt[f, Constants -> {B}] which does not work. it should be Dt[f,x, Constants -> {B} if you look at help you see the option Constants only works when you have also supplied an x in second argument? $\endgroup$
    – Nasser
    Commented Dec 16, 2023 at 2:43
  • 1
    $\begingroup$ You could do SetAttributes[B, Constant]. $\endgroup$
    – Carl Woll
    Commented Dec 17, 2023 at 1:10

1 Answer 1

5
$\begingroup$

Could you just set Dt[a] to zero?

Dt[a x y]

Mathematica graphics

Dt[a x y] /. Dt[a] -> 0

Mathematica graphics

Ad if you are using the version with Dt[f,x,Constants->{a}] you then use Dt[a,x] -> 0 instead.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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