Variation of parameters

We can use variation of parameters to solve a first order inhomogeneous ODE of the form

y˙+p(t)y=q(t). \dot y + p(t) y = q(t).

We first solve the homogeneous ODE y˙h+p(t)yh=0\dot y_h + p(t) y_h = 0. Then set y=u(t)yhy = u(t) y_h and plug into the inhomogeneous ODE. Terms will cancel.

Variation of parameters for an ODE system

We can apply a similar technique to an ODE system x˙=Ax+q\dot{\mathbf x} = A \mathbf x + \mathbf q. First write the homogeneous solution in terms of the fundamental matrix as x=eAtC\mathbf x = e^{At} \mathbf C, then replace C\mathbf C with a vector-valued function u(t)\mathbf u(t). Plugging into the ODE, we find

AeAtu(t)+eAtu˙(t)=Ax+q(t)Ax+eAtu˙(t)=Ax+q(t)eAtu˙(t)=q(t)u(t)=eAtq(t)dt. \begin{align*} Ae^{At} \mathbf u(t) + e^{At} \dot{\mathbf u}(t) &= A\mathbf x + \mathbf q(t) \\ A\mathbf x + e^{At} \dot{\mathbf u}(t) &= A\mathbf x + \mathbf q(t) \\ e^{At} \dot{\mathbf u}(t) &= \mathbf q(t) \\ \mathbf u(t) &= \int e^{-At} \mathbf q(t) \, \mathrm dt. \end{align*}