# Simplify products of scalar functions

+1 vote

There's probably a simple command to do this but I can't seem to find it. How do I simplify products of scalar functions whose partial derivatives are non-vanishing?

{a, b, c, d}::Indices(space1, position=independent).

\partial{#}::PartialDerivative.
f::Depends(\partial{#}).

ex:= f * f**2 * f**(-5);

How do I simplify this expression? Without the dependence on the partial derivatives the following works

simplify(ex);

This is what collect_factors is for. In general the simplify function is a sledge-hammer which should be avoided, as it calls through to SymPy to do the work, which is slow and prone to issues when the expression contains concepts which SymPy does not know about (like that implicit dependence).