Consider the homogeneous first-order linear differential equation(DE), $$\frac{dy}{dx}+P(x)y=0,$$ where $P(x)$ is continuous on an interval $I=(a,b)$. I'm trying to convince myself that its general solution on $I$ is $ce^{-\int P(x)dx}.$ My arguments are given below. I'll appreciate it if someone can confirm or refute it, or provide a simpler/better proof.
First of all, let's divide the solutions of the DE into two types. Type 1: $y(x)\ne 0$ for any $x\in I.$ And we call the rest of the solutions Type 2.
For Type 1 solutions, $y\ne 0$, so the DE is equivalent to:
$$\frac{1}{y}\frac{dy}{dx}=-P(x),$$
which can be solved by
$$\int \frac{1}{y}dy=-\int P(x)dx.$$
So the general Type 1 solution is $ce^{-\int P(x)dx}, c\ne 0.$ (Note that indeed $y\ne 0$ for any $x\in I.$)
Regarding Type 2 solutions, first note that the constant solution $y=0$ is clearly a Type 2 solution. Furthermore, we show it's the only Type 2 solution, by an argument similar to the one in why can't a non-constant solution of an autonomous DE intersect an equilibrium solution?:
Suppose $y(x)$ is a Type 2 solution with $y(\alpha)=0$ for some $\alpha\in I.$ Then by the existence and uniqueness theorem, $y(x)=0$ on $(\alpha-h, \alpha+h)\subset I$ for some $h>0.$ Let $\beta=\sup\{t: t\le b, y(t)=0, x\in (\alpha-h, t)\}$. Now suppose $\beta<b$. Then $y(\beta) \ne 0$, by definition and the existence and uniqueness theorem. But this means $y$ is discontinuous at $\beta$, contradicting the fact that $y$ has to be continuous. So we must have $\beta=b,$ and $y(x)=0$ for $x\in (\alpha-h, b)$. By the same token, we can show $y(x)=0$ for $x\in (a, \alpha+h)$ too.
Is this argument correct? Is there a simpler proof? Thanks a lot!
A better approach: Multiply the equation by the 'integrating factor' $e^{\int P(x)\, dx}$. The equation becomes $(ye^{\int P(x)\, dx})'=0$ so $ye^{\int P(x)\, dx}=c$ for some constant $c$. This gives all possible solutions of the DE.