Get Mathematica to factor constants out of definite integral [duplicate]

Say we have

Integrate[a f[x],{x,-Infinity,Infinity}]

And want Mathmatica to factor out a to get

a Integrate[f[x],{x,-Infinity,Infinity}]

This works automatically for the indefinite integral

Integrate[a f[x],x]

but I need it to work for the definite one in order to further simplify long expressions. Just applying Factor doesn't do it and FullSimplify even with assumption Element[a,Reals] doesn't either.

Am I missing some obvious assumption that makes it work? Or do I have to write some pattern matching expression?

Quite possibly related is the fact that Mathematica doesn't see an equality here:

FullSimplify[
Integrate[a f[x], {x, -Infinity, Infinity}] ==
a Integrate[f[x], {x, -Infinity, Infinity}], Element[a, Reals]]

This just returns the input expression again:

Integrate[a f[x], {x, -Infinity, Infinity}] ==
a Integrate[f[x], {x, -Infinity, Infinity}]

Edit: I just checked and this is even true if we make replace a by a natural number directly! Again the unaltered expression is returned.

I am on Mathematica 10.1.0.0

• Integrate[a f[x], {x, -Infinity, Infinity}] /. Integrate[a_, b_] :> Integrate[a, x] /. Integrate[a_, b_] :> Integrate[a, {x, -Infinity, Infinity}]?
– kglr
Aug 20 '19 at 13:37
• @kglr This works if x is the actual integration variable while a can be replaced by another symbol in this expression. I guess I was expecting something that would do it at once for integrals over any variable but for my current purpose this is actually enough. Aug 20 '19 at 14:12
• @WeavingBird1917 Yes! Thanks! This is close enough for a duplicate for me. The provided solution does what I want and is more general than klgr's suggestion. Aug 20 '19 at 14:44