A.2 First Order LDE

We’re interested in solving equations of the form

\[\begin{equation} y\prime(x) + q(x)y(x) = g(x) \tag{1.3} \end{equation}\]

The main complication is that we have a \(y\prime\) and a \(y\) term on the LHS. Recall that the product rule tells us that \((y\cdot \mu)\prime = y\prime\mu + \mu\prime y\). We might be able to tweak this result to get the LHS of Equation (1.3). Let’s see where introducing \(\mu\) takes us.

\[ \mu(x)y\prime(x) + \mu(x)q(x)y(x) = g(x)\mu(x) \]

Let’s apply the product rule trick to neatly package the RHS.

\[ (\mu\cdot y)\prime = \mu(x)y\prime(x) + \mu\prime(x)y(x) \]

Clearly \(\mu\prime(x)=\mu(x)q(x)\). This ODE is more manageable.

\[\begin{gather*} \frac{\mu\prime(x)}{\mu(x)} = q(x) \\ \int{\frac{\mu\prime(x)}{\mu(x)}}{x} = \int{q(x)}{x} \\ \ln(\mu(x)) = Q(x) + C \\ \end{gather*}\]

Now we have a closed form expression for \(\mu(x)\).8 \(\alpha = \exp(C)\)

\[ \mu(x) = \alpha\exp(Q(x)) \]

With that, we can go back to solving the original problem:

\[\begin{gather*} (\mu(x)\cdot y(x))\prime = g(x)\mu(x) \\ \mu(x)\cdot y(x) = \int{g(x)\mu(x)}{x} \\ \end{gather*}\]

\[\begin{equation} y(x) = \frac{\int{g(x)\mu(x)}{x}}{\mu(x)} \tag{1.4} \end{equation}\]

Notice that if \(\mu(x) = \alpha \exp(Q(x))\), \(\alpha\) will get factored out since it comes out of the integral in the numerator and cancels the same \(\alpha\) in the denominator. Thus, we can just ignore the integration constant for \(\alpha(x)\) and write \(\mu(x) = \exp(Q(x))\).9 N.B You must still include the integration constant for Equation (1.4) to deal with the initial condition.

Memorizing the final equation in the last section is not a valuable excercise. Instead, try to internalize the following steps:

  1. Compute \(\mu(x)\) the integrating factor
  2. Multiply both sides by \(\mu(x)\). A common mistake is to forget to multiply the RHS by \(\mu(x)\).
  3. Use the product rule in reverse to simplify the LHS.
  4. Integrate and pay attention to the integration constant