# Total derivative and constants

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

• 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? Commented Dec 16, 2023 at 2:43
• You could do SetAttributes[B, Constant]. Commented Dec 17, 2023 at 1:10

Could you just set Dt[a] to zero?
Dt[a x y]

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

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