Question # Solve the linear equations by considering y as a function of x, that is y=y(x) displaystyle{y}'-{2}{x}{y}={e}^{{{x}^{2}}}

Second order linear equations
ANSWERED Solve the linear equations by considering y as a function of x, that is
$$y=y(x)$$
$$\displaystyle{y}'-{2}{x}{y}={e}^{{{x}^{2}}}$$ 2020-12-29
Variation of parameters
First, solve the linear homogeneous equation by separating variables. Rearranging terms in the equation gives
$$\displaystyle{y}'={2}{x}{y}\Leftrightarrow\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}={2}{x}{y}\Leftrightarrow\frac{{{\left.{d}{y}\right.}}}{{y}}={2}{x}{\left.{d}{x}\right.}$$
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
$$\displaystyle\int\frac{{{\left.{d}{y}\right.}}}{{y}}={2}\int{x}{\left.{d}{x}\right.}$$
Which is
$$\displaystyle \ln{{\left|{{y}}\right|}}={x}^{2}+{c}$$
By taking exponents, we obtain
$$\displaystyle{\left|{{y}}\right|}={e}^{{{x}^{2}+{c}}}={e}^{{{x}^{2}}}\cdot{e}^{c}$$
Hence,we obtain
$$\displaystyle{y}={C}{e}^{{{x}^{2}}}$$
where $$\displaystyle{C}\:=\pm{e}^{c}{\quad\text{and}\quad}{y}_{{c}}={e}^{{{x}^{2}}}$$ is the complementary solution .
Next, we need to find the particular solution $$y_p$$
Therefore, we consider $$uy_c$$, and try to find u, a function of x, that will make this work.
Let's assume that $$uy_c$$ is a solution of the given equation. Hence, it satisfies the given equation.
Substituting $$uy_c$$, and its derivative in the equation gives
$$\displaystyle{\left({u}{y}_{{c}}\right)}'+{2}{x}{u}{y}_{{c}}={e}^{{{x}^{2}}}$$
$$\displaystyle{u}'{y}_{{c}}+{u}{y}'_{{c}}+{2}{x}{u}{y}_{{c}}={e}^{{{x}^{2}}}$$
$$\displaystyle{u}'{y}_{{c}}+\underbrace{{{u}{\left({y}'_{{c}}+{2}{x}{y}_{{c}}\right)}}}_{{\text{=0 }\ }}={e}^{{{x}^{2}}}$$
since $$y_c$$ is a solution
Therefore,
$$\displaystyle{u}'{y}_{{c}}={e}^{{{x}^{2}}}\Rightarrow{u}'=\frac{{{e}^{{{x}^{2}}}}}{{{y}_{{c}}}}$$
which gives
$$\displaystyle{u}=\int\frac{{{e}^{{{x}^{2}}}}}{{{y}_{{c}}}}{\left.{d}{x}\right.}$$
Now, we can find the function u:
$$\displaystyle{u}=\int{\left(\frac{{{e}^{{{x}^{2}}}}}{{{e}^{{{x}^{2}}}}}\right)}{\left.{d}{x}\right.}$$
$$\displaystyle=\int{\left.{d}{x}\right.}$$
\)=x+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=x Recall that \(y_p=uy_c$$
Therefore
$$\displaystyle{y}_{{p}}={x}{e}^{{{x}^{2}}}$$
The general solution is
$$y=Cy_c+y_p$$
$$\displaystyle={C}{e}^{{{x}^{2}}}+{x}{e}^{{{x}^{2}}}$$
$$\displaystyle={e}^{{{x}^{2}}}{\left({x}+{C}\right)}$$
Integration Factor technique
This equation is linear with $$\displaystyle{P}{\left({x}\right)}=-{2}{x}{\quad\text{and}\quad}{Q}{\left({x}\right)}={e}^{{{x}^{2}}}$$
Hence,
$$\displaystyle{h}=-{2}\int{x}{\left.{d}{x}\right.}=-{x}^{2}$$
So, an integrating factor is
$$\displaystyle{e}^{h}={e}^{{-{x}^{2}}}$$
and the general solution is
$$\displaystyle{y}{\left({x}\right)}={e}^{{-{h}}}{\left({c}+\int{Q}{e}^{h}{\left.{d}{x}\right.}\right)}$$
$$\displaystyle={e}^{{{x}^{2}}}{\left({c}+\int{e}^{{{x}^{2}}}\cdot{e}^{{-{x}^{2}}}{\left.{d}{x}\right.}\right)}$$
$$\displaystyle={e}^{{{x}^{2}}}{\left({c}+\int{\left.{d}{x}\right.}\right)}$$
$$\displaystyle={e}^{{{x}^{2}}}{\left({c}+{x}\right)}$$
Answer $$\displaystyle{y}={e}^{{{x}^{2}}}{\left({x}+{C}\right)}$$