My suggestion is that if you want to make changes
like this, you not use derivatives unless you really want
to use properties of derivatives.
(C1) 'diff(x,t);
dx
(D1) --
dt
(C2) part(d1,0);
(D2) DERIVATIVE
(C3) subst(d,d2,d1);
(D3) d(x, t, 1)
(C4) subst(d2,d,d3);
dx
(D4) --
dt
(C5)
Now it is clear that you need rules for d(x,t,1), d(x,t,2), ...
In general I think you will need
subst(d,nounify(derivative), .... 'diff(....))
You can also declare x to match anything in a certain set S, say
S:[x1,x2,x3];
pred(z):=member(z,S);
matchdeclare(x,z);
and you can change S to contain more or fewer elements.
Good luck
RJF
Andrei Zorine wrote:
> Hello,
> I want to write a function, which amongst all does what is done below.
> (C1) depends(x,t);
>
> (D1) [x(t)]
> (C2) tellsimp('diff(x,t),dx/dt);
>
> (D2) [DERIVATIVERULE1, SIMPDERIV]
> (C3) diff(x,t,2);
>
> (D3) 0
> (C4) diff(x,t);
>
> dx
> (D4) --
> dt
> (C5) :lisp $d4
>
> ((MTIMES SIMP) ((MEXPT SIMP) $dt -1) $dx)
>
> So, the function should look like
> f(x):=( ... do this and that, then tellsimp to substitute diff(x,t)
> with dx/dt, then do more and more...)
> My intention is to be able to do f(x1), f(x2), etc., and the have
> diff(x1,t,2)=0 , diff(x1,t)=dx1/dt, etc.
>
> the problem is either f(x1) results in tellsimp('diff(x,t),...).
>
> If I write a macro like buldq([x],'tellsimp('diff(x,t),dx/dt)), then
> tellsimp gets not evaluated :(
>
> How do I define patterns with differentiation of a function's argument?
>
> I have to say depends(x,t) to emulate mma's Dt call. Can I define
> simplification of 'diff(x,t) without saying depends(...) in the above
> framework?
>
> --
> Andrei Zorine
>