Second order non linear ODE - hard to solve integral makes me think I need a different substitution I have this here ODE:
$$xy'' = y' + x((y')^2 + x^2)$$
Naturally, I'd try this substitution first: $$y' = p, p=p(x)$$
The equation then transforms into $$xp' = p+x(p^2+x^2)$$
Dividing it by $x$, I get
$$p' = \frac{p}{x} + p^2 + x^2$$
Which is a Riccati equation with the solution: $$p = x \cdot \tan{(\frac{x^2}{2}+C_1)}$$
The thing is, if I substitute back $y'=p$, the integral on the right side is not an easy one to solve, and even if I do solve it with WolframAlpha the solutions are not the same as if I plug in the second-order equation directly. It makes me wonder if I should have tried another substitution/method.
Any help will be appreciated!

You have now a formula of the form
$$
y'(x)=f(u(x))u'(x)
$$
with $f(u)=\tan(u)$ and $u(x)=\frac{x^2}2+c$. This the gives that
$$
y(x)=F(u(x))+d,
$$
where $F'=f$, here $F(u)=-\ln|\cos(u)|$
