substituting function in diff



David Webb wrote:
> I am working on a 2-d wave problem and am trying to write a general function 
> which will replace expressions of the form:
>   z^2 * diff(wv(x,y,z,t),z,2) + ... + ...
> by a fourier integral equivalent:
>   ht(kx1,ky1,t)*ht(kx2,ky2,t)*diff(wv(kx3,ky3,t)*g(kx3,ky3,z),z,2)
> there being in implicit integral over kx1, ky1 etc. which I deal with later.
>   
I have not studied the problem here, but I suggest that
(a) You do NOT use "diff" anywhere in the problem unless you are 
actually computing a derivative of an expression that can actually be 
differentiated.
Like  x^2 -> 2*x.

If you just want a "form" to manipulate that takes,say, an expression 
f(x,y,z), and a list of variables and orders of derivatives, like 
[[x,2],[y,2],[z,1],[t,2]]
then invent such a form.  Say Df(f,[[x,n],[y,m] ....])

(b ) Devise a set of rules that will reduce Df(...) to other forms.
(c)  If in the rules you end up actually computing a derivative, use diff.

(d) learn about defrule, apply1, matchdeclare, to implement the rules.


Good luck.
RJF