A problem about apply rules



Dear everyone:
       I am a beginner. Maybe the problem is so easy, but I really
have no idea about it after several failure attempt.  Thanks for
everyone's help!

The problem is that :

Assume there is a rule about function P[n](x) such as :

P[n1](x) * P[n2](x) = sum( H(l) * P[l](x), l, 0,n2), where H() are
coefficients

eg. P[2](x) * P[4](x) = H(1)*P[1](x)
+H(2)*P[2](x)+H(3)*P[3](x)+H(4)*P[4](x)

Now ,there is a polynomial about P[n](x):

For example:  P[2](x)*P[3](x)*P[4](x)+ P[2](x)^2 + ...

How can I apply the rule above in this polynomial in MAXIMA?

Hydra