How can I build a unspecified mapping



jie liu wrote:
> I have an expression H(q), containing a time-varying variable q(t), I
> want to obtain the time derivative of the expression, in which the
> result will contain 'dq'the derivative of q(t), how can I realize it?
>
> I knew how to do this in Maple. You just establish a mapping of
> q:=q->(t), you differentiate the expression, and obtain the expression
> dH(q,dq/dt) , then substitute dq/dt with a new variable dq.  but
> Maxima does not provide such function, how can I do it?
>
>   
It's not entirely clear to me what you want, but you can do this:

gradef(q(t),dqdt);

diff(q(t)^2,t);

you get 2*q(t)*dqdt.

RJF