Riccati differential equations - Ansatz I'm practicing for a differential equations test, and I came across two Riccati equations which I find tricky:

$$xy'=x^{m+2n}y^2 + (2\sqrt{2}x^{m+n}-n)y+4x^m,$$ where $m, n \in \mathbb{N}$, and $$xy'=x^{2n}y^2+(m-n)y+x^{2m},$$ where $m, n \in \mathbb{N}$.

I'm aware that a Riccati equation can be reduced to a second order linear ODE, but we haven't covered higher order linear ODE's in class yet, so I'm trying to find an ansatz, and then reduce the equation to a Bernoulli equation, etc.
Is there a good ansatz for these equations?
I was able to find $y_{1} = \frac{\sqrt{2}(i-1)}{x^n}$ for the first equation and $y_{2} = ix^{m-n}$ for the second one, but both of these use $i$, which I don't think I can do in these cases.
 A: Take your second equation to the next step, bypassing the Bernoulli stage,
$$
y=ix^{m-n}+\frac1u
$$
inserted results in
$$
i(m-n)x^{m-n}-\frac{xu'}{u^2}=-x^{2m}+\frac{2ix^{m+n}}{u}+\frac{x^{2n}}{u^2}+i(m-n)x^{m-n}+\frac{m-n}u+x^{2m}
\\~\\
-xu'=2ix^{m+n}u+x^{2n}+(m-n)u
$$
This now is a linear DE of order 1 which can be solved using standard methods. You will need to select those complex integration constants that render the full solution for $y$ real.
The or at least one solution family is
$$
y(x)=x^{m-n}\tan\left(\frac{x^{m+n}}{m+n}-a\right)
$$
A: Both are mentioned in http://science.fire.ustc.edu.cn/download/download1/book%5Cmathematics%5CHandbook%20of%20Exact%20Solutions%20for%20Ordinary%20Differential%20EquationsSecond%20Edition%5Cc2972_fm.pdf#page=108
For $xy'=x^{m+2n}y^2+(2\sqrt2x^{m+n}-n)y+4x^m$ ,
The book suggested the substitution $w=yx^n$ ,
Then $y=wx^{-n}$
$y'=w'x^{-n}-nwx^{-n-1}$
$\therefore x(w'x^{-n}-nwx^{-n-1})=x^mw^2+(2\sqrt2x^m-nx^{-n})w+4x^m$
$x^{1-n}w'-nx^{-n}w=x^mw^2+(2\sqrt2x^m-nx^{-n})w+4x^m$
$x^{1-n}w'=x^mw^2+2\sqrt2x^mw+4x^m$
$x^{1-m-n}\dfrac{dw}{dx}=w^2+2\sqrt2w+4$
Which belongs to a separable ODE.
For $xy'=x^{2n}y^2+(m-n)y+x^{2m}$ ,
Although the book only claims the general solution $y=x^{m-n}\tan\left(\dfrac{x^{m+n}}{m+n}+C\right)$ , we can guess the substitution $y=x^{m-n}u$ ,
Then $y'=x^{m-n}u'+(m-n)x^{m-n-1}u$
$\therefore x(x^{m-n}u'+(m-n)x^{m-n-1}u)=x^{2m}u^2+(m-n)x^{m-n}u+x^{2m}$
$x^{m-n+1}u'+(m-n)x^{m-n}u=x^{2m}u^2+(m-n)x^{m-n}u+x^{2m}$
$x^{m-n+1}u'=x^{2m}u^2+x^{2m}$
$x^{1-m-n}\dfrac{du}{dx}=u^2+1$
Which belongs to a separable ODE.
