Question: Where is the error?

Hello,

I tried to define the Poisson bracket in this way

restart:
Ps:=proc(f,g)
local P;
P:=simplify(diff(f,P[1])*diff(g,X)-diff(f,X)*diff(g,P[1])+
diff(f,P[2])*diff(g,Y)-diff(f,Y)*diff(g,P[2]));
end;

The problem is that, if I ask Ps(P[1],X) I got 0 which is clearly wrong.

Where is the error?

https://dl.dropboxusercontent.com/u/51122291/Scrreshot.jpeg

Thanks Nicola 

Please Wait...