[Math] Finding a general solution to a differential equation, using the integration factor method

calculusintegrationmultivariable-calculusordinary differential equations

Use the method of integrating factor to solve the linear ODE

$$ y' + 2xy = e^{−x^2}.$$

And verify your answer


I can solve the ODE as a linear equation (mulitply both sides, subsititute, reverse product rule, integrate etc.) to obtain the answer

$$
y(x) = c_1 e^{-x^2} e^{-x^2}x
$$

However could someone show me how to do this question using the integrating factor method and (subsequently verifying it using that method?)

Best Answer

We have, $$y'+2xy=e^{-x^2}$$ Compare above ODE with Leibniz equation $\frac{dy}{dx}+P(x)y=Q(x)$, we get, $P(x)=2x $ & $Q(x)=e^{-x^2}$

Now, Integration factor $$I.F.=e^{\int P(x)dx}=e^{\int 2xdx}=e^{x^2}$$ Hence, the general solution is given as $$y(I.F.)=\int Q(x)(I.F.) dx+c$$ $$\implies y(e^{x^2})=\int e^{-x^2}(e^{x^2}) dx+c$$ $$\implies ye^{x^2}=\int dx+c=x+c$$ $$\bbox[5px, border:2px solid #C0A000]{\color{red}{y=e^{-x^2}(x+c)}}$$ Where $c$ is the constant of integration