Solving a two degree Differential equation (ordinary) with a variable coefficient The question is to solve the following integral equation:
$$y(x)=x-\int_{1}^{x}xy(t) dt; y \in C^1[1,\infty)$$
My try:
I differentiated twice to get the ordinary equation $$y''(x)+xy'(x)+2y(x)=0$$
Now this is an ordinary differential equation with a variable coefficient. This is not in the usual "Cauchy-Euler Equation". So I just made a change of variable $x=u(t)$ hoping to get $u(t)$ somewhere at the end. Now after the substitution $\frac{dx}{dt}=u'(t)$. So $$\frac{dy}{dx}=\frac{dy}{dt}.\frac{dt}{dx}=\frac{1}{u'(t)}\frac{dy}{dt}.$$
Similarly $$\frac{d^2y}{dx^2}=\frac{d}{dt}\left(\frac{1}{u'(t)}\frac{dy}{dt}\right)\frac{dt}{dx}=\frac{1}{(u'(t))^2}\frac{d^2y}{dt^2}-\frac{u''(t)}{(u'(t))^3}\frac{dy}{dt}$$
Substituting these in the original equation we end up with 
$$\frac{d^2y}{dt^2}+\frac{dy}{dt}\left(\frac{u(t)(u'(t))^2-u''(t)}{(u'(t))}\right)+2(u'(t))^2y(t)=0$$
This makes me guess $2(u'(t))^2=k$ where $k$ is a constant. Then we get $u(t)=\sqrt{\frac{k}{2}}t$. But this should make the coefficient of $\frac{dy}{dt}$ a constant which is not happening. 
Where did I go wrong??
Thanks for the help!!
 A: Note that, multiplying through by $x$:
$y'' + xy'+2y = 0$
$ \implies xy'' +\dfrac{d}{dx}[x^2 y] = 0$
$ \implies xy' - y = -x^2 y + C_1 $ (by parts on LHS)
$\implies y' + [(x^2-1)/x]y = C_1/x$
This has integrating factor $I(x) = \exp {(x^2/2)}/x$, so multiplying through the above by $I(x)$:
$\implies \dfrac{d}{dx}\left[\frac{y\exp (x^2/2)}{x}\right] = C_1\dfrac{\exp(x^2/2)}{x^2}$
$\implies y(x) = C_1x\exp(-x^2/2) \displaystyle\int^xt^{-2}\exp (t^2/2) dt + C_{2}x\exp(-x^2/2)$
$\implies y(x) = C_1x\exp (-x^2/2)\left[-x^{-1}\exp (x^2/2) + \underbrace{\displaystyle\int^x \exp (t^2/2)dt}_{=\sqrt{\frac{\pi}{2}}\text{erfi}(x/\sqrt{2})}\right] + C_2x\exp(-x^2/2)$ (by parts)
Hence, for arbitrary constants $A,B$:
$y(x)=A\left(x\exp (-x^2/2)\sqrt{\frac{\pi}{2}}\text{erfi}(x/\sqrt{2}) -1\right) + Bx\exp(-x^2/2)$
Which is (allegedly) equivalent to:
$y(x) = A\left(\sqrt 2 xD_{-}(x/\sqrt 2) - 1\right) + Bx\exp(x^2/2)$,
where $D_{-}$ is a Dawson function.
A: You can try to find solutions of this ODE that can be written as an infinite series around $0$ i.e. $y(x)=\displaystyle \sum_{n=0}^{+\infty}a_nx^n$.
Such a function $y(x)=\displaystyle \sum_{n=0}^{+\infty}a_nx^n$ is a solution if and only if its coefficients satisfy the relation : $$\forall n\geq 0, \qquad (n+1)a_{n+2}+a_n=0 \qquad (1)$$
So, you get two formal solutions : $$y_0(x)=\sum_{n=0}^{+\infty} (-1)^n\dfrac{2^nn!}{(2n)!}x^{2n}$$ and $$y_1(x)=\sum_{n=0}^{+\infty} \dfrac{(-1)^n}{2^nn!}x^{2n+1}.$$
One can easily check that both $y_0$ and $y_1$ converge on $\mathbb R$ and $y_1$ admits a closed form $$y_1(x)=xe^{-x^2/2}.$$
Moreover, $y_0$ and $y_1$ are two linearly independent functions of your 2nd order linear differential equation so that any solution of your ODE is a linear combination of $y_0$ and $y_1$:
$$y(x)=\alpha y_0 + \beta xe^{-x^2/2}, \qquad \alpha,\beta \in \mathbb R.$$
