Solving Riccati ODEs I have recently started studying the methods behind solving different types of differential equations and have made it to Bernoulli with no problems thus far. However, as I was investigating Riccati ODEs I noticed that many sources are inconsistent with the substitution that is used to reduce a Riccati equation to Bernoulli. I would like to pose the following ODE:
$$
y' = y^2 -xy +1 
$$
If you know any good resources to use to attain a better understanding of this type of equation please let me know. Thank you in advance for your time. 
 A: As far es I know the name "Ricatti equation" $($for example see here, equation $(4)$$)$ in the context of differential equations refers to specific type of non-linear first order DEs. To be precise in general to equations of the form

$$y'+p(x)y+q(x)y^2=r(x)\tag1$$

which are only solvable for the case that you know one particular solution $y_1(x)$. The general solution can be obtained by making the substitution
$$y=y_1(x)+v(x)\tag2$$
Plugging this new form into the original equation leads to 
$$\begin{align}
(y_1+v)'+p(x)(y_1+v)+q(x)(y_1+v)^2&=r(x)\\
y_1'+v'+p(x)y_1+p(x)v+q(x)y_1^2+q(x)v^2+2q(x)v&=r(x)\\
v'+(2q(x)y_1+p(x))v+q(x)v^2+\underbrace{[y_1'+p(x)y_1+q(x)y_1^2-r(x)]}_{=0}&=0
\end{align}$$
where the term within the braces vanishs since $y_1$ - as a particular solution to $(1)$ - fulfills the given DE. From hereon we are left with the equation

$$v'+(2q(x)y_1+p(x))v+q(x)v^2=0$$

which is just a Bernoulli equation in $v$. Solving this one and recombining with the particular solution as stated in $(2)$ yields to the general solution.

Lets focus on your given DE. 
$$y'+xy-y^2=1\tag{I}$$
It is not hard to see that a particular solution would be $y_1(x)=x$. By using the ansatz as provided before we will consider the general solution to be of the type
$$y=y_1(x)+v(x)\Rightarrow y=x+v(x)$$
By plugging this within $($I$)$ we obtain
$$\begin{align}
(x+v(x))'+x(x+v(x))-(x+v(x))^2&=1\\
1+v'(x)+x^2+xv(x)-x^2-v^2(x)-2xv(x)&=1\\
v'(x)-xv(x)-v^2(x)&=0\\
\Leftrightarrow -\frac{v'(x)}{v^2(x)}+\frac{x}{v(x)}+1&=0
\end{align}$$
This DE is now of Bernoulli type and can be solved by considering the substitution $z=\frac1{v(x)}$ which leads to $z'=-\frac{v'(x)}{v^2(x)}$ and thus $z'+xz+1=0$. The general solution to this ODE is given by 
$$z(x) = c_1 e^{-x^2/2} - \sqrt{\frac{\pi}2} e^{-x^2/2} \operatorname{erfi}\left(\frac x{\sqrt{2}}\right)$$
which can be obtained by Separation of Variables and Variation of Variables respectively. What is left now are the resubstitutions. So we get for $v(x)$
$$v(x)=\frac1{z}\Leftrightarrow v(x)=\frac1{c_1 e^{-x^2/2} - \sqrt{\frac{\pi}2} e^{-x^2/2} \operatorname{erfi}\left(\frac x{\sqrt{2}}\right)}=\frac{e^{x^2/2}}{c_1 - \sqrt{\frac{\pi}2} \operatorname{erfi}\left(\frac x{\sqrt{2}}\right)}$$
and so finally for the general solution 
$$y=y_1(x)+v(x)=x+\frac{e^{x^2/2}}{c_1 - \sqrt{\frac{\pi}2} \operatorname{erfi}\left(\frac x{\sqrt{2}}\right)}$$
A: $$y' = y^2 -xy +1$$
Here is how to reduce it to Bernouilli's equation
$$(y-x)'=y(y-x)$$
$$\frac {d(y-x)}{dx}=y(y-x)$$
$$\frac {d(y-x)}{dx}=(y-x+x)(y-x)$$
Substitute $z=y-x$
$$z'=(z+x)z \implies z'=zx+z^2$$
This is Bernouilli's equation ( see mrtaurho' s complete answer for the solution ...)
A: Another variant is to consider $u=e^{-Y}$ where $Y=\int y\,dx$, or $y=-\frac{u'}{u}$, so that $u'=-e^{-Y}y$ and $$u''=e^{-Y}(y^2-y')=e^{-Y}(xy-1)=-xu'-u$$
This equation in particular can now be integrated once to
$$
u'+xu=C
$$
and this now is a first order linear ODE.
