# Take the derivative of a function of time by another function of time [duplicate]

What I am asking could seem simple but I couldn't find a solution nor here nor in google.
I want to take the derivative of a function by another function. Let say I have two functions of time y[t] and x[t] (and some other parameters). In my code they both have a certain dependence on t. I would like to derive y by x and have the result expressed in function of time as well. Something like D[y[t], x[t]]. I know that I could simply calculate D[y[t], t] / D[x[t], t].
But isn't there a more direct way? Just out of curiosity ...

• See chainD in my answer to Higher-order partial derivatives w.r.t. variable raised to some power – Carl Woll Jul 20 '17 at 7:23
• This D[y[t], t] / D[x[t], t] actually is a most direct way. You may easily write a custom function for that, if you like. Something like der[y_[t_], x_[t_]] := D[y[t], t]/D[x[t], t]. Then der[Sin[t], Cos[t]] yields -Cot[t]. – Alexei Boulbitch Jul 20 '17 at 12:14
• @CarlWoll Thank you. That function works OK. Even though I am not into Mathematica language enough to understand why. Maybe it would take some time. If you could give me some hints I would be grateful but it is not vital for me at the moment so don't worry. – LastStarDust Jul 21 '17 at 7:52
• @AlexeiBoulbitch you are right. The function that I wrote proved to be the most simple way that gets the job done. But it is always good to have feedback. Thank you – LastStarDust Jul 21 '17 at 7:52

In[1]:= Dt[a[t] x[t] + b[t], x[t]]

• I am sorry this is not working in my case. Maybe it is valid only in case you leave the functions unspecified. In my case the have a well defines dependence on t. To be more specific one is a[t]=someparameters Log[t] and the other is b[t]=someotherparameters Log[t]. And I would like to calculate d a[t] / d b[t]. – LastStarDust Jul 21 '17 at 7:47