Existence-Uniqueness Theorem for First-Order Differential Equation

Theorem
Let $P$ and $Q$ be continuous functions on some open interval $I \subseteq \R$.

Let $a \in I$.

Let $b \in \R$.

There is a unique function $f(x)=y$ on $I$ that satisfies the differential equation


 * $y' + P(x)y = Q(x)$ along with the initial condition


 * $f(a)=b$

This function is


 * $\displaystyle f(x) = be^{-A(x)} + e^{-A(x)}\int_a^x Q(t) e^{A(t)} dt$ where $\displaystyle A(x) = \int_a^x P(t)dt$

Existence
If $P$ and $Q$ are continuous, then they are integrable, and we may use the Fundamental Theorem of Calculus on definite integrals involving these functions.

Therefore, $f'(x) + P(x) f(x) = Q(x)$. For the initial condition,

Uniqueness
Suppose $f$ is a solution to the differential equation and satisfies the initial condition. Let $g(x) = f(x) e^{A(x)}$.

Moreover, $g(a) = b$. By the Second Fundamental Theorem of Calculus,


 * $\displaystyle g(x) = \int_a^x Q(t) e^{A(t)} dt + b$

Furthermore, $\displaystyle f(x) = g(x) e^{-A(x)}$. Therefore, we can conclude that


 * $\displaystyle f(x) = be^{-A(x)} + e^{-A(x)}\int_a^x Q(t) e^{A(t)} dt$