I have a complicated expression, which among other things has stuff like functions of rational functions:
expr = f[x/(-x^2 + y)] + f[-(x/(x^2 - y))] (* + ...*) If you apply Simplify to the whole expression, they combine, which is what I ultimately want to achieve:
Simplify[expr] (* 2 f[-(x/(x^2 - y))] ... *) However, my complicated expression is so complicated, I prefer not to apply any top-level functions on the entire thing, since it will take a lot of time.
My solution to this problem is to map these top-level functions to the arguments of f like so,
expr /. f[x_] :> f[Simplify[x]] in the hopes of making the fractions look the same so that they combine. But it doesn't work. Is there another way to achieve this task? (putting these fractions in canonical form, etc.)
expr /. f[x_] :> f[Factor[x]]works for the example provided. $\endgroup$Together[]for this. $\endgroup$Factordoesn't work for-(x/(a^2 - x))andx/(-a^2 + x)$\endgroup$f[x_?(Internal`RationalFunctionQ[#, Reduce`FreeVariables[#]] &)] :> f[Together@Apart@x]Is that what you had in mind. Quite a lot of undocumented functions there... $\endgroup$Factor2.mfile in the "general" folder of the compressed file you get when you download the latest version of FeynCalc. $\endgroup$