# substituting Green's function in non homogeneous diff eq

I am solving the following differential equations with Mathematica 8:

DSolve[{x''[t] + r x[t] == DiracDelta[t], x[0] == 0, x'[0] == 1},
x[t], t]
DSolve[{x''[t] + r x[t] == F[t], x[0] == 0, x'[0] == 1},
x[t], t]


Here is my question: the first one gives me the Green's function, how can I tell Mathematica to write "G" in place of the whole green's function in the solution of the second one? The simple:

Simplify[%,{...}]


won't work because in the integration the integration variable is automatically changed and I should change accordingly every time.

Here is the full output:

{{x[t] -> HeavisideTheta[t] Sin[t]}}

{{x[t] -> -Cos[t] \!$$\*SubsuperscriptBox[\(\[Integral]$$, $$1$$, $$0$$]$$\(\(-F[ K[1]]$$\ Sin[K[1]]\) \[DifferentialD]K[1]\)\) + Cos[t] \!$$\*SubsuperscriptBox[\(\[Integral]$$, $$1$$, $$t$$]$$\(\(-F[ K[1]]$$\ Sin[K[1]]\) \[DifferentialD]K[1]\)\) +
Sin[t] - (\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$1$$, $$0$$]$$\(Cos[K[2]]\ F[ K[2]]$$ \[DifferentialD]K[2]\)\)) Sin[t] + (\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$1$$, $$t$$]$$\(Cos[K[2]]\ F[ K[2]]$$ \[DifferentialD]K[2]\)\)) Sin[t]}}


As you can see in the integration I have K[1] and K[2]: how can I tell mathem. to substitute the Green's function all at once?

-
Maybe you want to define bigG[r_, t_] = x[t] /. First@ DSolve[{x''[t] + r x[t] == DiracDelta[t], x[0] == 0, x'[0] == 1}, x[t], t] and then use it as any other function ? –  b.gatessucks Aug 1 '13 at 10:33
Yes i want to use the solution to the first as any other function, but how do I tell mathematica to substitute it everytime I need? To be clear, here is the full output –  mattiav27 Aug 1 '13 at 10:47
Where does the first solution appear in the second output ? I don't see any HeavisideTheta[t] for instance. –  b.gatessucks Aug 1 '13 at 11:36
That affects the integration limits –  mattiav27 Aug 1 '13 at 11:55
Given an expression with integrals, how would one differentiate terms due to HeavisideTheta[t] from the rest ? –  b.gatessucks Aug 1 '13 at 12:01