# Why doesn't Mathematica cancel this constant out of the integral?

I have the mathematical expression

Integrate[f[r], {r, τ, t}] == a*Integrate[f[r]/a, {r, τ, t}]


which is obviously true for all functions f[r] if a is a constant. However, Mathematica does not simplify the above expression to "true". Even Simplify and FullSimplify don't work. What am I doing wrong?

• Sorry no idea. Surprisingly Simplify[Integrate[f[r], r] == a*Integrate[f[r]/a, r] , Assumptions -> a > 0] works! Aug 6, 2020 at 11:18
• Simplify[Integrate[f[r], r] == a*Integrate[f[r]/a, r], Assumptions -> a != 0] does the job. Aug 6, 2020 at 11:51
• In the case of indefinite integrals, the cancellation appears to work even without Simplify (in MA 12.0.0.0) Aug 6, 2020 at 12:11
• @user64494 It does not matter in this case, since the result does not depend on the value of a (the limit $a\rightarrow 0$ is defined). Integrate[f[r], r] == a*Integrate[f[r]/a, r] yields True for me Aug 6, 2020 at 12:28
• @user64494 Execute x/x. Aug 6, 2020 at 12:35

Mathematica does not like to take things out of integrals.

You can define the following rule:

repl = Integrate[x_ y__, {var_, bounds__}] /; FreeQ[x, var] :>
x Integrate[y, {var, bounds}];


And then Mathematica will happily factor out the "constants"

Integrate[f[r], {r, τ, t}] ==
a*Integrate[f[r]/a, {r, τ, t}] /. repl
(* True *)

• That breaks in this case for me: (f[t] * Integrate[g[r], {r, a, t}] == Integrate[f[t]*g[r], {r, a, t}]) /. repl evaluates the RHS integral without integrating. (But it does cancel constants...) Aug 6, 2020 at 11:36
• @HerpDerpington Your example works for me (MA 12.0.0.0) Aug 6, 2020 at 12:05
• @Hausdorff I have MA 8.0.0.0 Aug 6, 2020 at 12:06