       Re: Differential operators, Help

• To: mathgroup at smc.vnet.net
• Subject: [mg25364] Re: [mg25332] Differential operators, Help
• From: BobHanlon at aol.com
• Date: Sun, 24 Sep 2000 03:01:32 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```In a message dated 9/23/2000 4:03:07 AM, wkb at ansto.gov.au writes:

>This should be relatively easy, but after several tries I have not been
>able
>to do it.
>
>I want define a differential operator in the following way. Let Dx and
>Dx2
>denote the operators for first and second order differentiation with respect
>to x. I want P to be an operator which depends on x,  Dx and Dx2.
>
>For example, with
>
>                  P = Dx2 + x Dx
>
>I want P[f[z],z] = f''[z] + z f'[z].
>
>This much I can do, but I cannot find a method which also gives the
>following result,
>
>P[ P[f[z],z], z]  -> (f''[z] + z f'[z])''+ z (f''[z] + z f'[z])'
>
>Or more generally, if I have two such operators P and Q I want the correct
>result from expressions such as
>
>      P[ Q[f[x],x], x]
>

P[expr_, x_Symbol:x] := D[expr, {x, 2}] + x*D[expr, x];

Q[expr_, x_Symbol:x] := D[expr, {x, 2}] - 2x^2*D[expr, x];

P[f[z], z]

z*Derivative[f][z] + Derivative[f][z]

P[P[f[z], z], z] // Simplify

z*Derivative[f][z] + (2 + z^2)*Derivative[f][z] +
2*z*Derivative[f][z] + Derivative[f][z]

D[f''[z] + z f'[z], {z, 2}] + z *D[f''[z] + z f'[z], z] == % // Simplify

True

P[ Q[f[x]]]

-4*Derivative[f][x] - 8*x*Derivative[f][x] -
2*x^2*Derivative[f][x] +
x*(-4*x*Derivative[f][x] - 2*x^2*Derivative[f][x] +
Derivative[f][x]) + Derivative[f][x]

Bob Hanlon

```

• Prev by Date: Re: About N in Mathematica 4
• Next by Date: RE: Differential operators, Help
• Previous by thread: Differential operators, Help
• Next by thread: RE: Differential operators, Help