[Math] Solve the differential equation $\frac{dy}{dx} – xy=1$

calculusordinary differential equations

Solve the differential equation $\frac{dy}{dx} – xy=1$ given $y(0)=1$

The given differential equation is a first order linear differential equation of the form $\frac{dy}{dx} + Py=Q$

The integrating factor is $$e^{\int Pdx}=e^{-\int xdx}=e^{-\frac{x^2}{2}}$$

Solution is $$ye^{-\frac{x^2}{2}}=\int e^{-\frac{x^2}{2}}dx + c$$

But how do I integrate the second term?

Best Answer

So far, you've solved the differential equation correctly.


The integral you are considering does not have an elementary antiderivative. Regardless, we can still obtain an exact solution in terms of the error function. The considered integral is: $$\int e^{-\frac{x^2}{2}}~dx$$ Now, substitute $$u=\frac{x}{\sqrt{2}} \implies du=\frac{1}{\sqrt{2}}~dx\implies dx=\sqrt{2}~du$$ This gives an integral which is contained in the definition of the error function: $$\int e^{-\frac{x^2}{2}}~dx=\sqrt{2}\cdot \int e^{-u^2}~du$$ The definition of the error function is:

$$\operatorname*{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}~dt$$

It follows from the definition that: $$\int e^{-u^2}~du=\frac{\sqrt{\pi}}{2}\cdot \operatorname*{erf}(u)+C$$ Can you continue? From solving the integral, you can find the general solution to your ODE, and then find the solution where $y(0)=1$.

Related Question