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!

$$y' = x \cdot \tan{\left(\frac{x^2}{2}+C\right)}$$
$$\dfrac {dy}{du}\dfrac {du}{dx} = x \cdot \tan(u)$$
$$\dfrac {dy}{du} =  \tan(u)$$
Where $u=\dfrac {x^2}{2}+C$ then integrate.
$$y=-\ln |\cos u |+K$$
