Re: Q: pattern in list of derivatives
- To: mathgroup at smc.vnet.net
- Subject: [mg22758] Re: [mg22696] Q: pattern in list of derivatives
- From: BobHanlon at aol.com
- Date: Fri, 24 Mar 2000 03:28:05 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
expr = a*D[u[x, y], y] + c*D[D[u[x, y], x], y]
a*Derivative[0, 1][u][x, y] + c*Derivative[1, 1][u][x, y]
The pattern for the derivative needs two underlines since you are trying to
match a sequence.
Cases[{expr}, Derivative[__][u][x, y], -1]
{Derivative[0, 1][u][x, y], Derivative[1, 1][u][x, y]}
Bob Hanlon
In a message dated 3/22/2000 1:53:13 AM, k.duellmann at uni-mannheim.de writes:
>I can extract all derivatives from
>
>e.g. s1 = a u'[x] + a u''[x]
>
>by Cases[{s1}, Derivative[_][u][x],-1] and get
>
>{u'[x],u''[x]}
>
>
>But for mixed derivatives
>
>e.g. {a u[x,y]^(0,1) + c u[x,y]^(1,1)}
>
>the correponding command Cases[{s1}, Derivative[_][u][x,y],-1]
>doesn't work and I receive only the empty list {}.