3
$\begingroup$

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.)

$\endgroup$
15
  • $\begingroup$ expr /. f[x_] :> f[Factor[x]] works for the example provided. $\endgroup$ Commented Jun 11, 2016 at 10:35
  • 1
    $\begingroup$ You could use Together[] for this. $\endgroup$ Commented Jun 11, 2016 at 11:43
  • $\begingroup$ @MariusLadegårdMeyer Thanks, but Factor doesn't work for -(x/(a^2 - x)) and x/(-a^2 + x) $\endgroup$ Commented Jun 11, 2016 at 14:54
  • 2
    $\begingroup$ @J.M. So here's what I came up with: 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$ Commented Jun 11, 2016 at 18:25
  • 1
    $\begingroup$ @QuantumDot I think you are looking for the Factor2.m file in the "general" folder of the compressed file you get when you download the latest version of FeynCalc. $\endgroup$ Commented Jun 12, 2016 at 20:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.