Skip to main content

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

p(t)xโ€ณ+q(t)xโ€ฒ+r(t)x=0,x(s)=0,xโ€ฒ(s)=1.

Once we solve the above IVP for general s, we're done! If, say, xs(t) solves the above IVP, then our particular solution is

Y(t)=โˆซt0txs(t)g(s) ds,

where t0 is a constant on the interval the original inhomogeneous ODE is defined on.

Subsection 2.2.1 Solve xโ€ณโˆ’4x=et

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, which has the general solution

x(t)=c1e2t+c2eโˆ’2t.

Now, we want to solve an initial value problem: we want to solve the IVP given by

xsโ€ณ(t)โˆ’4xs(t)=0,xs(s)=0,xsโ€ฒ(s)=1.

Since \(x_s''(t) - 4x_s(t) = 0\text{,}\) we can write

\begin{align*} x_s(t) \amp = a e^{2t} + be^{-2t} \end{align*}

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:

\begin{gather*} \begin{cases} 0 = ae^{2s} + be^{-2s}, \\ 1 = 2ae^{2s} - 2be^{-2s}. \end{cases} \end{gather*}

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

\begin{gather*} \begin{cases} 0 = a_1 + b_1, \\ 1 = 2a_1 - 2b_1, \end{cases} \end{gather*}

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

\begin{align*} x_s(t) \amp = \frac14 e^{-2s} e^{2t} - \frac14 e^{2s} e^{-2t} = \frac{e^{2(t-s)} - e^{-2(t-s)}}{4}. \end{align*}

The solution to this IVP is

xs(t)=e2(tโˆ’s)โˆ’eโˆ’2(tโˆ’s)4.

With this, Duhamel's principle helps us pretty quickly write a particular solution Y(t) of xโ€ณโˆ’4x=et:

Y(t)=โˆซt0txs(t)g(s)p(s) ds=โˆซt0te2(tโˆ’s)โˆ’eโˆ’2(tโˆ’s)4โ‹…es ds.

The variable t0 can be any number in the domain of the ODE xโ€ณโˆ’4x=et, basically meaning that t0 can be any real number, since the ODE holds for all reals.

We might choose t0=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=et is

x(t)=c1e2t+c2eโˆ’2t+โˆซ0te2(tโˆ’s)โˆ’eโˆ’2(tโˆ’s)4โ‹…es ds.

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

\begin{align*} x(t) \amp = c_1 e^{2t} + c_2 e^{-2t} + \int_{0}^t \frac{e^{2(t-s)} - e^{-2(t-s)}}{4} \cdot g(s) \ ds. \end{align*}

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.