A first-order linear equation in standard form is written like this:
\[ y' + p(x)y = q(x) \]
We start by multiplying both sides by an unknown function \(u(x)\):
\[ u(x) y' + u(x) p(x)y = u(x)q(x) \]
Let \(u(x)\) be a function such that \(u'(x) = u(x)p(x)\):
\[ u(x) y' + u'(x)y = u(x)q(x) \]
Now we can use the product rule here:
\[ \frac{d}{dx} \left( y u(x) \right) = u(x)q(x) \]
We can rewrite this as:
\[u(x) \ dy = u(x)q(x) \ dx \]
Integrating both sides:
\[\int u(x) \ dy = \int u(x)q(x) \ dx \]
Evaluting and simplifying:
\[\begin{gathered} u(x)y = \int u(x)q(x) \ dx \\ y = \frac{1}{u(x)}\left[ \int u(x)q(x) \ dx \right] \end{gathered}\]
This is our solution. As for \(u(x)\), let's try to find an equation for it. We can start with:
\[ \frac{d}{dx} u'(x) = u(x)p(x) \]
Rearranging:
\[ \frac{1}{u(x)} d(u(x))= p(x) \ dx \]
Integrating both sides and evaluating:
\[\begin{gathered} \int \frac{1}{u(x)} \ d(u(x))= \int p(x) \ dx \\ \ln |u(x)| = \int p(x) \ dx + C \end{gathered}\]
Making \(u(x)\):
\[\begin{aligned} |u(x)| &= e^{\int p(x) \ dx + C} = e^{\int p(x) \ dx}e^C \\ &= e^{\int p(x) \ dx}D\end{aligned}\]
Since \(D\) can be a positive or negative constant:
\[ u(x) = D e^{\int p(x) \ dx} \]