I know there is functionality in Mathematica to perform replacements like:
x[a] d[a,b]/.y_[z_] d[z_,p_]->y[p]
Which naturally gives x[b]
as a result. Now, I was wondering if there is a stronger generalization, such that:
x[a]Subscript[q,a]Superscript[m,a]d[a,b]/. y_ d[z_,p_]->(set all occurrences of z to p in y)
was done automatically and the result would be x[b]Subscript[q,b]Superscript[m,b]
? What syntax should I use to achieve that? thanks for any suggestion!