 2021-02-25

Solve the linear equations by considering y as a function of x, that is, y = y(x).
$\frac{dy}{dx}-y=4{e}^{x},y\left(0\right)=4$ 2abehn

Variation of parameters
First, solve the linear homogeneous equation by separating variables. Rearranging terms in the equation gives
$\frac{dy}{dx}=y⇔\frac{dy}{y}=dx$
Now, the variables are separated, x appears only on the right side, and y only on the left.
Integrate the left side in relation to y, and the right side in relation to x
$\int \frac{dy}{y}=\int dx$
which is$\mathrm{ln}|y|=x+c$
By taking exponents, we obtain
$|y|={e}^{x+c}={e}^{x}\cdot {e}^{c}$
Hence,we obtain
$y=C{e}^{x}$
where $C\phantom{\rule{0.222em}{0ex}}=±{e}^{c}\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}{y}_{c}={e}^{x}$ is the compleentary solution
Next, we need to find the particular solution ${y}_{p}$.
Therefore, we consider $u{y}_{c}$, and try to find u, a function of x, that will make this work.
Let's assume that $u{y}_{c}$. is a solution of the given equation. Hence, it satisfies the given equation. Substituting $u{y}_{c}$, and its derivative in the equation gives
${\left(u{y}_{c}\right)}^{\prime }-u{y}_{c}=4{e}^{x}$
${u}^{\prime }{y}_{c}+u{y}_{c}^{\prime }-u{y}_{c}=4{e}^{x}$

since ${y}_{c}$ is a solution
Therefore
${u}^{\prime }{y}_{c}=4{e}^{x}⇒{u}^{\prime }=\frac{4{e}^{x}}{{y}_{c}}$
which gives
$u=\int \frac{{e}^{x}}{{y}_{c}}dx$
Now, we can find the function u :
$u=\int \frac{4{e}^{x}}{{e}^{x}}dx$
$=4\int dx$
$=4x+c$
Since we need to find only one function that will male this work, we don’t need to introduce the constant of integration c. Hence,
$u=4x$
Recall that ${y}_{p}=u{y}_{c}$. Therefore,
${y}_{p}=4x{e}^{x}$
The general solution is
$y=C{y}_{c}+{y}_{p}$
$={e}^{x}\left(C+4x\right)$
Integrating Factor technique
This equation is linear with $P\left(x\right)=-1\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}Q\left(x\right)=4{e}^{x}$
Hence,
$h=\int Pdx=-\int dx=-x$
So, an integrating factor is
${e}^{h}={e}^{-x}$
and the general solution is
$y\left(x\right)={e}^{-h}\left(c+\int Q{e}^{h}dx\right)$