$yy''-(y')^2=-y^2$

We want to solve the differential equation :

• $$yy''-(y')^2=-y^2$$
• $$y(0)=1, y'(0)=0$$

• $$\left(\frac{y'}{y}\right)'=\frac{yy''-y'^2}{y^2}=-1$$
• therefore $$y(x) =e^{ \frac{-x^2}2}$$

How would you solve it, without trick, with a general method ?

Since the ODE is of the form: $$\Psi(y,y',y'')=0\$$ You can substitute $$p=\dfrac {dy}{dx}$$ and $$y''=p\dfrac {dp}{dy}$$. So that: $$yy''-(y')^2=-y^2$$ Becomes: $$yp'-p=-\dfrac {y^2}{p}$$ This is Bernoulli's differential equation.
A general second order ODE has the form $$\Psi(x,y,y',y'')=0\ ,$$ and your problem is of this sort. There are some special such equations, e.g., linear ODEs with constant coefficients, for which there is a standard algorithm. But there is no general method that solves any ODE of the above form. When you find a solution nevertheless this is not a trick, but luck.