Via TransformationFunctions
:
Clear[xf];
xf[e_] :=
e /. {Integrate[int_, {x_, a_, b_}] - Integrate[int_, {x_, a_, c_}] :>
Integrate[int, {x, c, b}],
coeff_ Integrate[int_, {x_, a_, b_}] :>
Integrate[coeff int, {x, a, b}]};
sol = DSolve[{f'[t] + f[t]*g[t] == h[t], f[0] == f0}, {f[t]}, t];
Simplify[sol,
TransformationFunctions -> {xf, Expand, Collect[#, Power[E, _]] &, Automatic}]
(*
{{f[t] -> E^Integrate[-g[K[1]], {K[1], 0, t}] * f0 +
Integrate[E^Integrate[-g[K[1]], {K[1], K[2], t}]*h[K[2]], {K[2], 0, t}]}}
*)
To get the answer in the form requested (it's not "simpler" according to the default ComplexityFunction
of Simplify
:
% /. {Integrate[int_, {x_, t, b_}] :> -Integrate[int, {x, b, t}]} /.
{K[1] -> s, K[2] -> τ}
(*
{{f[t] -> E^Integrate[-g[s], {s, 0, t}] * f0 +
Integrate[E^Integrate[-g[s], {s, τ, t}] * h[τ], {τ, 0, t}]}}
*)