solution of differential equation $\left(\frac{dy}{dx}\right)^2-x\frac{dy}{dx}+y=0$
Here's another approach. Differentiating gives $y''\left(2y'-x\right)=0$, so $y''=0$ or $y'=\frac{x}{2}$. The former option gives $y=ax+b$ so $a^2-ax+ax+b=0$ and $b=-a^2$. The latter option gives $y=\tfrac{x^2}{4}+c$ so $\frac{x^2}{4}-\frac{x^2}{2}+\tfrac{x^2}{2}+c=0$, which work iff $c=0$. The solution is $y=ax-a^2$ or $y=\frac{x^2}{4}$.
$$y'(x)^2-xy'(x)+y(x)=0\Longleftrightarrow$$ $$y(x)=-y'(x)^2+xy'(x)\Longleftrightarrow$$ $$y'(x)=xy''(x)+y'(x)-2y'(x)y''(x)\Longleftrightarrow$$ $$y'(x)=y'(x)+y''(x)\left(x-2y'(x)\right)\Longleftrightarrow$$ $$y''(x)\left(x-2y'(x)\right)=0$$
Now, solve them separately:
- For the first one:
$$y''(x)=0\Longleftrightarrow$$ $$\int y''(x)\space\text{d}x=\int0\space\text{d}x\Longleftrightarrow$$ $$\int y'(x)\space\text{d}x=\text{C}_1\Longleftrightarrow$$
Substitute $y'(x)=\text{C}_1$ into $y(x)=xy'(x)-y'(x)^2$:
$$y(x)=\text{C}_1x-\text{C}_1^2$$
- For the second one:
$$x-2y'(x)=0\Longleftrightarrow$$
$$y'(x)=\frac{x}{2}\Longleftrightarrow$$
Substitute into $y(x)=xy'(x)-y'(x)^2$:
$$y(x)=\frac{x^2}{4}$$
So, finally we found that:
$$y(x)=\frac{x^2}{4}\space\space\space\space\space\space\space\text{or}\space\space\space\space\space\space\space y(x)=\text{C}_1x-\text{C}_1^2$$