# Solution of a homogenous differential equation with constant coefficients.

I was reading this Wikipedia article. I tried to adopt the same method that they used to solve the following diffrential equation:

$$y\frac {d^2(y)}{dx^2}+{(\frac {dy}{dx})}^2+y^2=0$$ Putting $$y=e^{rx}$$ and then taking out $$e^{2rx}$$ outside with $$2r^2+1$$ inside. Solving for $$r$$ we get $$y=e^{\frac{ix}{\sqrt 2}}$$ or $$y=e^{-\frac{ix}{\sqrt 2}}$$ and when we combine both results as one and apply euler form of complex number we get $$y=a\cos {\frac{x}{\sqrt 2}} + b\sin {\frac{x}{\sqrt 2}}$$ but when I used Wolfram Alpha (computational software) to verify my solution by plugging in the solution into the diffrential equation I don't get $$0$$ but $$1$$. I am not able to identify what I did wrong. It would be very nice if you could help me with identifying my mistake. Thanks a lot.

• Hint: Instead, try $$p = y' \implies p' = y''$$ Substitute those two and solve and then substitute again. – Moo Oct 15 '18 at 19:22
• your equation is not linear – LostInSpace Oct 15 '18 at 19:54

$$y\frac {d^2(y)}{dx^2}+{(\frac {dy}{dx})}^2+y^2=0$$ $$\color {red} {y''y+(y')^2}+y^2=0$$ $$\color {red}{(y'y)'}+y^2=0$$ $$(2y'y)'+2y^2=0$$ $$((y^2))''+2y^2=0$$ Substitute $$u=y^2$$ $$u''+2u=0$$ This is linear.... $$r^2+2=0 \implies r=\pm i\sqrt 2$$ $$\implies u=c_1\cos(\sqrt 2 x)+c_2 \sin ( \sqrt 2 x)$$ $$\boxed {y^2(x)=c_1\cos(\sqrt 2 x)+c_2 \sin ( \sqrt 2 x)}$$

Another method is

$$y'=\frac {dy}{dx}=p$$ And $$y''=\frac {dp}{dx}=\frac {dp}{dy}\frac {dy}{dx}=pp'_y$$ The equation becomes $$pp'y+p^2+y^2=0$$ Note that $$(p^2)'=2pp'$$ $$\frac 12 (p^2)'y+(p^2)+y^2=0$$ Substitute $$u=p^2$$ $$u'+2\frac uy=-2y$$ Its linear of first order...

• I solved the linear first order. I get the same answer as I got by wikipedia method. I think wolfram alpha is giving wrong answer. – Mayank Mittal Oct 15 '18 at 20:25
• Wa gives the right answer...you sure you put the right equation ? @infinitelycurious – LostInSpace Oct 15 '18 at 20:26
• @infinitelycurious I don't know but type just $y'$ for $\frac {dy}{dx}$ I typed the equation in wa wolframalpha.com/input/?i=yy%27%27%2B(y%27)%5E2%2By%5E2%3D0 – LostInSpace Oct 15 '18 at 20:31
• I think that del stuff which it is accepting instead of dy/dx is making the diff. Now I feel bad for wasting your time as well as mine but atleast I learned a few new methods to solve DE. – Mayank Mittal Oct 15 '18 at 20:38
• @infinitelycurious no problem we are here here to help one another...so it was my pleasure to answer your question...Take care – LostInSpace Oct 15 '18 at 20:40

Let $$v(y)=\frac{dy(x)}{dx}$$ then $$2\frac{dv(y)}{dy}v(y)+\frac{2v(y)^2}{y}=-2y$$ Now let $$u(y)=v(y)^2$$ then $$\frac{du(y)}{dy}+\frac{u(y)}{y}=-2y$$ Can you proceed?

• You did a calculation mistake. It must be 2u(y)/y. Although, I get the same answer as what I got before through that wikipedia method. Is there a possibility that Wolfram aplha is giving wrong answer? – Mayank Mittal Oct 15 '18 at 20:23

If you look sharp enough, the first two terms have the form of a product derivative. Indeed $$(yy')'=yy''+(y')^2$$. This in turn is the derivative of the square, so that in the end the ODE is equivalent to $$(y^2)''+2(y^2)=0$$ which is an oscillation equation for $$u=y^2$$ with solutions $$y^2=u=A\sin(\sqrt2 x+\phi).$$ As these sinoids also take negative values, the solution for $$y$$ has some sudden stops.

Or in initial conditions: $$y(x)^2=y(0)^2\cos(\sqrt2 x)+\sqrt2y(0)y'(0)\sin(\sqrt2 x)$$ so that the square root with the correct sign is $$y(x)=y(0)\sqrt{\cos(\sqrt2 x)+\sqrt2\frac{y'(0)}{y(0)}\sin(\sqrt2 x)}.$$

• your idea seems correct but if we follow isham's another method, we get a continious expression for y. Isnt that contradictory? I think A will turn negative in that case because if we conpare both of them, A is actually related to c1 and c2 and ince c1 and c2 are complex. A might take a negative value. – Mayank Mittal Oct 15 '18 at 20:43
• If you allow complex values for $y$, then you need the more general solution formula. Our expressions are the same, that is equivalent forms, if $y$ is restricted to be a real function. – Lutz Lehmann Oct 15 '18 at 20:51