MATLAB: Mupad partial time derivative

mupad

Hi, I've been working with mupad for some time, but I'm really surprised by the recent situation:
I've been doing some time derivative, but when the expression includes higher devirative of the same variable, it suddenly equals zero, idk why.
Any ideas how to fix this?
this is what i mean:
code:
A:=q(t)
AA:=diff(A|[q(t)=s],s)|[s=q(t)]
B:=(q(t)*diff(q(t),t))
BB:=diff(B|[q(t)=s],s)|[s=q(t)]
I'd expect diff(q(t),t)) instead of 0.

Best Answer

You substitute s for q(t), so B transforms into s*diff(s,t) . s is constant with respect to t so diff(s,t) is 0 and s*0 is 0 (provided that s is finite) so s*diff(s,t) is going to collapse to 0. Then you take the derivative of that 0 with respect to s, which is going to be 0.