# How do I use Distribute in integral?

I use of Distribute for multiply a parameter in Integral. I write the following code:

Distribute[
p*Integrate[(u[0][x] + p*u[1][x] + p^2*u[2][x])/Sqrt[t - x], {x, 0,
t}]]


I want the following output:

Integrate[(p*u[0][x])/Sqrt[t - x], {x, 0, t}] +
Integrate[(p^2*u[1][x])/Sqrt[t - x], {x, 0, t}] +
Integrate[Plus[(p^3*u[2][x])/Sqrt[t - x]], {x, 0, t}]


Any suggestion?

exp = p Integrate[(u[0][x] + p u[1][x] + p^2 u[2][x]) / Sqrt[t - x], {x, 0, t}];

ExpandAll[exp] /.  a_ Integrate[b_, c_] :> (Integrate[a #, c] & /@ b)


To have the p's outside Integrates:

ExpandAll[exp] /.  p Integrate[b_,  c_] :>
((p Replace[#, Except[p^_.] :> 1, Infinity] Integrate[  # /. p -> 1, c]) & /@ b)


• Many thanks. Is there any war for the following output: p*Integrate[u[0][x]/Sqrt[t - x], {x, 0, t}] + p^2*Integrate[u[1][x]/Sqrt[t - x], {x, 0, t}] + p^3*Integrate[u[2][x]/Sqrt[t - x], {x, 0, t}] Mar 16, 2018 at 7:50
• @AbdolAli, maybe ExpandAll[exp] /. p Integrate[b_, c_] :> (( p Replace[#, Except[p^_.] :> 1, Infinity] Integrate[ # /. p -> 1, c]) & /@ b) ?
– kglr
Mar 16, 2018 at 8:09