How to solve $\frac{dy}{dx}=5xy + \sin x$? How do I solve $\frac{dy}{dx}=5xy + \sin x$ explicitly? With $y(0) = 1$. I am asked to use an integrating factor. What I did:
$\frac{dy}{dx}-5xy = \sin x \\ \text{Integrating factor:} \ e^{\int{-5x\ dx}} = e^{-\frac{5}{2}x^2} \\ \frac{d}{dx}\left[e^{-\frac{5}{2}x^2}y\right] = e^{-\frac{5}{2}x^2}\sin x \\ e^{-\frac{5}{2}x^2}y = \int e^{-\frac{5}{2}x^2}\sin x \ dx$
How would I proceed from there?
Edit: $y(0) = 1$.
Also, when does the scalar ODE (above) have a unique solution?
 A: Rewrite ODE into form :
$(5xy+\sin x)dx-1\cdot dy=0$
Next , let's denote :
$M=5xy+\sin x ~\text{and}~ N=1$ , then :
integrating factor $u(x)$ is given by :
$$u(x)=e^{\int\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}\,dx}=e^{\frac{5}{2}x^2}$$
Use this procedure to find solution of ODE .
A: This is a linear, non-homogeneous, differential equation. Mathematica suggests the solution $$\left\{\left\{y(x)\to \frac{1}{20} e^{\frac{5 x^2}{2}} \left(20
   c_1+\frac{i \sqrt{10 \pi } \left(\text{erf}\left(\frac{5
   x+i}{\sqrt{10}}\right)+i \text{erfi}\left(\frac{1+5 i
   x}{\sqrt{10}}\right)\right)}{\sqrt[10]{e}}\right)\right\}\right\}.$$
Your approach if perfectly correct, since linear equation always have an integrating factor. Yours has $e^{\frac{5}{2}x^2}$. I'm afraid you won't find an elementary solution, since $\int e^{-\frac{5}{2}x^2}\sin x\, \mathrm{d}x$ can't be expressed in terms of elementary functions. Of course, this does not mean that the exercise is impossible.
