0
$\begingroup$

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?

$\endgroup$
23
  • 3
    $\begingroup$ Sorry no idea. Surprisingly Simplify[Integrate[f[r], r] == a*Integrate[f[r]/a, r] , Assumptions -> a > 0] works! $\endgroup$ Aug 6, 2020 at 11:18
  • 4
    $\begingroup$ Simplify[Integrate[f[r], r] == a*Integrate[f[r]/a, r], Assumptions -> a != 0] does the job. $\endgroup$
    – user64494
    Aug 6, 2020 at 11:51
  • 1
    $\begingroup$ In the case of indefinite integrals, the cancellation appears to work even without Simplify (in MA 12.0.0.0) $\endgroup$
    – Hausdorff
    Aug 6, 2020 at 12:11
  • 1
    $\begingroup$ @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 $\endgroup$
    – Hausdorff
    Aug 6, 2020 at 12:28
  • 1
    $\begingroup$ @user64494 Execute x/x. $\endgroup$
    – Michael E2
    Aug 6, 2020 at 12:35

1 Answer 1

2
$\begingroup$

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 *)
$\endgroup$
3
  • $\begingroup$ 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...) $\endgroup$ Aug 6, 2020 at 11:36
  • $\begingroup$ @HerpDerpington Your example works for me (MA 12.0.0.0) $\endgroup$
    – Hausdorff
    Aug 6, 2020 at 12:05
  • $\begingroup$ @Hausdorff I have MA 8.0.0.0 $\endgroup$ Aug 6, 2020 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.