# Problem with eliminate_metric and product_rule

Hi everyone!

I am here to ask another question. I hope it not be a silly one!
In the following code:

I can't figure out why the productrule() after the substitute(_, gamma) doesn't work. Also the eliminate_metric in the final of the code doesn't work too!

Regards!

edited

+1 vote

In general, please try to boil down your problem to something that can be displayed here, because dropbox files tend to have a short lifetime.

product_rule only works when you have a derivative acting on a product. It does not work when you have a derivative acting on a sum of products. In those cases, you first need to distribute the derivative over the terms in the product.

Thanks for spotting the second issue. eliminate_metric should by default act at an arbitrary level in the expression, but has deep=False as default argument, and hence does not go into the individual terms of the sum which forms your expression. You can work around this bug for the time being by using

eliminate_metric(_, deep=True);

selected