General Solution To Linear First Order ODEs

2023/10/21 2:38 PM PDT

A linear ordinary differential equation (ODE) is any equation of the form:

an(x)dnydxn+an1(x)dn1ydxn1++a1(x)dydx+a0(x)y=f(x) a_{n}(x)\frac{d^{n}y}{dx^{n}} + a_{n-1}(x)\frac{d^{n-1}y}{dx^{n-1}} + \cdots + a_{1}(x)\frac{dy}{dx} + a_{0}(x)y = f(x)

This differential equation is ordinary because it only contains derivatives of a single dependent variable, y. It is linear because each derivative of yy is linear (i.e. there is no (dydx)2(\frac{dy}{dx})^{2} etc.). A first order linear ODE contains only the first derivative.

dydx+a0(x)y=f(x) \begin{equation} \frac{dy}{dx} + a_{0}(x)y = f(x) \end{equation}

Linear ODEs of this type have a general solution that can be found through the use of an integrating factor. The goal is to choose an integrating factor, p(x)p(x), such that the above form is equivalent to:

ddx(py)=p(x)f(x) \frac{d}{dx}(py) = p(x)f(x)

Notice that this can be rewritten as:

dydx+1pdpdx=f(x) \begin{equation} \frac{dy}{dx} + \frac{1}{p}\frac{dp}{dx} = f(x) \end{equation}

By comparing (1) and (2), we notice that p(x)p(x) is an integrating factor if and only if

1pdpdx=a0(x) \frac{1}{p}\frac{dp}{dx} = a_{0}(x)

By inspection we can see that a solution for p(x)p(x) is

p(x)=ea0(x)dx p(x) = e^{\int{a_{0}(x)}dx}

Now the solution of (1) can be found by integration.

ddx(py)dx=p(x)f(x)dxp(x)y(x)=p(x)f(x)dx+Cy(x)=1p(x)p(x)f(x)dx+C \begin{aligned} \int\frac{d}{dx}(py)dx &= \int p(x)f(x)dx\\\\ p(x)y(x) &= \int p(x)f(x)dx + C\\\\ y(x) &= \frac{1}{p(x)}\int p(x)f(x)dx + C \end{aligned}

And we have our solution. Note that there are other ways to solve linear ODEs that may be much faster than this for specific scenarios. However this solution works in all cases.

There was a problem communicating with the server.

Please check your network connection and try again later.