# How do you solve y'=-xy+sqrty given y(0)=1?

Oct 9, 2017

See below.

#### Explanation:

Making $y = {z}^{2}$ we obtain

$z \left(x z + 2 z ' - 1\right) = 0$ or $z = 0$ and $x z + 2 z ' - 1 = 0$

We discard $z = 0$ due to the initial conditions so we follow with

$2 z ' + x z - 1 = 0$ which is a linear non-homogeneous differential equation with solution

$z = C {e}^{- \left({x}^{2} / 4\right)} + {e}^{- \left({x}^{2} / 4\right)} {\int}_{0}^{\frac{x}{2}} {e}^{- {\xi}^{2}} d \xi$ and then

$y = \pm \sqrt{{e}^{- \left({x}^{2} / 4\right)} \left(C + {\int}_{0}^{\frac{x}{2}} {e}^{- {\xi}^{2}} d \xi\right)}$

and

$y \left(0\right) = \pm \sqrt{C} = 1$ then $C = 1$ and

$y = \pm \sqrt{{e}^{- \left({x}^{2} / 4\right)} \left(1 + {\int}_{0}^{\frac{x}{2}} {e}^{- {\xi}^{2}} d \xi\right)}$