Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Please help with Rule in Mathematica' topicStudent Support Forum > General > Archives > "Please help with Rule in Mathematica"

Next Comment >Help | Reply To Topic
Author Comment/Response
01/16/12 06:25am

Please help the idiot
In[] = D[p[x,t],x,t]/.{Derivative[n_,m_][p_][q__]->a^(n+m)}
Out[] = a^2

In[] = D[p[x,t],x,t]/.{Derivative[n__][p_][q__]->a^Plus[n]}
Out[] = a

WTF??? Why not a^2????

In the simplest case
In[] = D[p[x,t],x,t]/.{Derivative[n__][p_][q__]->Plus[n]}
Out []=Sequence[1, 1]

Ok. Now
In[] = D[p[x,t],x,t]/.{Derivative[n__][p_][q__]->Plus[n,1]}
Out []= 3

In[] = D[p[x,t],x,t]/.{Derivative[n__][p_][q__]->(Plus[n,1]-1)}
Out []=Sequence[1, 1]

How it works????

URL: ,

Subject (listing for 'Please help with Rule in Mathematica')
Author Date Posted
Please help with Rule in Mathematica Igor 01/16/12 06:25am
Re: Please help with Rule in Mathematica toen 01/17/12 8:29pm
Next Comment >Help | Reply To Topic