Section 2.2 A Familiar Example
Duhamel's Principle can look pretty complicated at first (mainly because of the \(S(t;s)\)), but the particular solution it gives is quite elegant.
At it's core, Duhamel's Principle “off-loads” solving a nonhomogeneous ODE \(p(t)y''+q(t)y' + r(t)y = g(t)\) into solving the homogeneous initial value problem
Once we solve the above IVP for general \(s\text{,}\) we're done! If, say, \(x_s(t)\) solves the above IVP, then our particular solution is
where \(t_0\) is a constant on the interval the original inhomogeneous ODE is defined on.
Subsection 2.2.1 Solve \(x'' - 4x = e^t\)
We solved this problem back in the Variation of Parameters chapter, but we had to use a lot of computations to arrive at an answer.
Here, we'll see that using Duhamel's Principle shortcuts us right to the answer.
As always, the first thing we do is solve the homogeneous ODE \(x'' - 4x = 0\text{,}\) which has the general solution
Now, we want to solve an initial value problem: we want to solve the IVP given by
Question 2.2.1. How do I solve this IVP?
Since \(x_s''(t) - 4x_s(t) = 0\text{,}\) we can write
for some constants \(a,b\text{.}\) We just need to solve for \(a,b\text{,}\) given that \(x_s(s) = 0\) and \(x_s'(s) = 1\text{.}\) These correspond to a system of equations:
This might seem daunting, especially with the \(e^{2s}\) and \(e^{-2s}\) factors, but remember that these are constants with respect to \(t\text{,}\) \(a\text{,}\) and \(b\text{.}\) So, the system above might as well be solving the system
where, \(a_1 = ae^{2s}\) and \(b_1 = be^{-2s}\text{.}\)
This system's pretty easy to solve: \(a_1 = 1/4\) and \(b_1 = -1/4\text{.}\) In all, this means that \(a = a_1 e^{-2s} = e^{-2s}/4\) and \(b = b_1 e^{2s} = -e^{2s}/4\text{,}\) so the solution \(x_s(t)\) to the IVP mentioned is
The solution to this IVP is
With this, Duhamel's principle helps us pretty quickly write a particular solution \(Y(t)\) of \(x'' - 4x = e^t\text{:}\)
The variable \(t_0\) can be any number in the domain of the ODE \(x'' - 4x = e^t\text{,}\) basically meaning that \(t_0\) can be any real number, since the ODE holds for all reals.
We might choose \(t_0 = 0\) and evaluate the integral using Mathematica. The appropriate command is
Integrate[(Exp[2 (t - s)] - Exp[-2 (t - s)])/4 * Exp[s], {s, 0, t}]
But, of course, we might just leave it in the form that it is and get that the general solution to \(x'' - 4x = e^t\) is
Question 2.2.2. Bonus: Solve \(x'' - 4x = g(t)\).
This is extremely easy with Duhamel's Principle. We just have to replace the \(e^s\) with \(g(s)\) in our integral. So, the general solution to \(x'' - 4x = g(t)\) is
This generalization might've been harder had we used variation of parameters instead. In general, if you have to solve a lot of inhomogeneous ODEs that have the same homogeneous ODE, then Duhamel's principle reduces down the number of ODEs needed to solve down to 1.