I'm trying to find solution for $$ \frac{d^2y}{dx^2}+y^2=0 $$
Can this differential equation(it is nonlinear, isn't it?) be solved analytically?
Or do I have to resort to numerical method?
The solution of $$ \frac{d^2y}{dx^2}-y^2=0 $$ should be fine, too.
substitute $p=y'$ and conclude $y''=p\frac{dp}{dy}$ because $$y''=\frac{dy'}{dx}=\frac{dp}{dx}=\frac{dp}{dy}\frac{dy}{dx}=\frac{dp}{dy}y'=\frac{dp}{dy}p$$
then get $p\frac{dp}{dy}+y^2=0 \Rightarrow pdp=-y^2dy\Rightarrow p^2=-\frac{y^3}{3}+C \Rightarrow p= \pm \sqrt{C-\frac{y^3}{3}}$ then substitute for $p$ $$\frac{dy}{dx}=\pm\sqrt{C-\frac{y^3}{3}} \Rightarrow \frac{dy}{\pm\sqrt{C-\frac{y^3}{3}}} = dx$$ this last integral cant be evaluated.
also we can use this method for the second equation too: $$p\frac{dp}{dy}-y^2=0\Rightarrow p^2=\frac{y^3}{3}+C \Rightarrow p= \pm \sqrt{C+\frac{y^3}{3}}\Rightarrow \frac{dy}{\pm\sqrt{C+\frac{y^3}{3}}} = dx$$ again this integral can't be evaluated.