# Solution to Linear First Order Ordinary Differential Equation

## Theorem

A linear first order ordinary differential equation in the form:

- $\dfrac {\d y} {\d x} + \map P x y = \map Q x$

has the general solution:

- $\ds y = e^{-\int P \rd x} \paren {\int Q e^{\int P \rd x} \rd x + C}$

## Proof 1

Consider the first order ordinary differential equation:

- $\map M {x, y} + \map N {x, y} \dfrac {\d y} {\d x} = 0$

We can put our equation:

- $(1): \quad \dfrac {\d y} {\d x} + \map P x y = \map Q x$

into this format by identifying:

- $\map M {x, y} \equiv \map P x y - \map Q x, \map N {x, y} \equiv 1$

We see that:

- $\dfrac {\partial M} {\partial y} - \dfrac {\partial N} {\partial x} = \map P x$

and hence:

- $\map P x = \dfrac {\dfrac {\partial M} {\partial y} - \dfrac {\partial N} {\partial x} } N$

is a function of $x$ only.

It immediately follows from Integrating Factor for First Order ODE that:

- $e^{\int \map P x \rd x}$

is an integrating factor for $(1)$.

So, multiplying $(1)$ by this factor:

- $e^{\int \map P x \rd x} \dfrac {\d y} {\d x} + e^{\int \map P x \rd x} \map P x y = e^{\int \map P x \rd x} \map Q x$

The result follows by an application of Solution to Exact Differential Equation.

$\blacksquare$

## Proof 2

From the Product Rule for Derivatives:

\(\ds \frac \d {\d x} \paren {e^{\int \map P x \rd x} y}\) | \(=\) | \(\ds e^{\int \map P x \rd x} \dfrac {\d y} {\d x} + y e^{\int \map P x \rd x} \map P x\) | ||||||||||||

\(\ds \) | \(=\) | \(\ds e^{\int \map P x \rd x} \paren {\dfrac {\d y} {\d x} + \map P x y}\) |

Hence, multiplying $(1)$ all through by $e^{\int \map P x \rd x}$:

- $\dfrac \d {\d x} \paren {e^{\int \map P x \rd x} y} = \map Q x e^{\int \map P x \rd x}$

Integrating with respect to $x$ now gives:

- $\ds e^{\int \map P x \rd x} y = \int \map Q x e^{\int \map P x \rd x} \rd x + C$

whence we get the result by dividing by $e^{\int \map P x \rd x}$.

$\blacksquare$

## Also presented as

The **Solution to Linear First Order Ordinary Differential Equation** is also presented as:

- $\ds y e^{\int P \rd x} = \int Q e^{\int P \rd x} \rd x + C$

## Also see

- Solution to Linear First Order ODE with Constant Coefficients, a specific instance

## Sources

- 1968: Murray R. Spiegel:
*Mathematical Handbook of Formulas and Tables*... (previous) ... (next): $\S 18$: Basic Differential Equations and Solutions: $18.2$: Linear first order equation - 1998: David Nelson:
*The Penguin Dictionary of Mathematics*(2nd ed.) ... (previous) ... (next):**differential equation**: differential equations of the first order and first degree: $(5)$*Linear equations* - 2008: David Nelson:
*The Penguin Dictionary of Mathematics*(4th ed.) ... (previous) ... (next):**differential equation**: differential equations of the first order and first degree: $(5)$*Linear equations*