6

I'd like to prove the linearity of integration over one real variable ($x$).

Integrate[f[x] + b g[x], x] == Integrate[f[x],x] + b Integrate[g[x],x]

which I was hoping would return True, but doesn't.

I've tried all manner of assumptions (e.g., $b \in \mathbb{R}_{\geq 0}$), without success. Is there a natural way of ensuring $f$ and $g$ are integrable?

xzczd
  • 65,995
  • 9
  • 163
  • 468
David G. Stork
  • 41,180
  • 3
  • 34
  • 96
  • Somewhat related: https://mathematica.stackexchange.com/q/40432/1871 https://mathematica.stackexchange.com/q/56237/1871 – xzczd Feb 01 '23 at 05:23

2 Answers2

9

Since this is the Indefinite Integration, the two sides are the sets of functions rather than a single functons. The = actual means that the set of left hand side is equal to the set of right hand side.

D[Integrate[f[x] + b g[x], 
   x] - (Integrate[f[x], x] + b Integrate[g[x], x]), x]

0

cvgmt
  • 72,231
  • 4
  • 75
  • 133
7

You can use TransformationFunctions in order to Distribute the integration.

Simplify[
 Integrate[f[x] + b g[x], x] == 
  Integrate[f[x], x] + b Integrate[g[x], x], 
 TransformationFunctions -> {Automatic, # /. 
     smthng_Integrate :> Distribute[smthng] &}]

t

Edit: not sure if you are interested in the following

replacement = 
  Integrate[x_ + y_, z_] :> Integrate[x, z] + Integrate[y, z];

and then

(Integrate[f[x] + b g[x], x] /. replacement) == 
 Integrate[f[x], x] + b Integrate[g[x], x]

t

bmf
  • 15,157
  • 2
  • 26
  • 63
  • 1
    This makes me think about applying parity to functions in the case of symmetric intervals; taking advantage of the fact that in the case of odd functions, it's not necessary to integrate. – E. Chan-López Feb 01 '23 at 01:15
  • 1
    @E.Chan-López that's a good and useful point for definite integrals! – bmf Feb 01 '23 at 01:26
  • 4
    @bmf: That's neat (thanks)... but if you distribute the integration you're basically ensuring the distribution property, not testing it... no? – David G. Stork Feb 01 '23 at 01:57
  • 2
    @DavidG.Stork yes, indeed. you are right about that. I guess you meant to test if the functions are Lebesque integrable, right? I am unaware of how to go about proving that. – bmf Feb 01 '23 at 02:23