Question: Issues with Collecting Terms in Code – Unusual Behavior and Errors

I’m currently trying to collect terms in an expression f^G(xi), but the result is not behaving as expected. I attempted two different coding approaches, but both resulted in errors. This particular case of collecting terms seems to be different from what I’ve encountered before, and I’m unsure how to resolve it.

Could you please advise on how to properly collect the terms in this situation and avoid the errors? Any insight into why this case behaves differently would also be appreciated.

Thank you for your help.

collect_term.mw

Please Wait...