# How to solve the differential equation $y'' = -y/2$ (for a beginner to differential equations)

In AP Calculus AB class we had this worksheet problem: solve the differential equation $$y'' = -y/2$$. (The general solution, not just one possible solution.)

Apparently, the answer is: $$y=A\cos(x/\sqrt2)+B\sin(x/\sqrt2)$$, where $$A$$ and $$B$$ are any real numbers.

Quite frankly, I have no idea how to go about finding that solution. In class, we have basically been told to just solve differential equations by "guessing and checking." (We have not yet learned integration in class, although I have studied integrals a bit outside of class.)

How would I go about solving that? And where the heck does the $$\sqrt2$$ come from? I recall that the general solution to the related equation $$y'' = -y$$ is $$y=A\cos(x)+B\sin(x)$$. (Although I don't entirely understand how you find that, either.)

• I wish I could help more, but I only remember the more terse way to solve these problems in general. Are you familiar with linear algebra, in particular eigenvectors and eigenvalues? By any chance a bit about complex numbers? – clm Nov 1 '19 at 23:34
• @clm I know what a vector is, and have done some basic work with complex numbers (e.g. $e^{ix}$) but I don't know about eigenvectors and eigenvalues unfortunately. – Will Nov 1 '19 at 23:50

If you start with $$y=e^{kx}$$ and plug into your equation you get $$k^2e^{kx}=-1/2 e^{kx}$$ which gives you $$k=\pm i\sqrt 2 /2$$

Thus you get $$y=e^{\pm i (\sqrt 2/2x) } = \cos (\sqrt 2 /2x)\pm i \sin (\sqrt 2 /2x)$$

Since your equation is linear any linear combination of solutions are also solutions thus the real part and the imaginary parts of the above are also solutions.

That explains the trig solutions.

• Is this solution missing some $x$'s in the final line? – Will Nov 2 '19 at 2:42
• Also, why does this method work? Why can you just "plug in" $y = e^{kx}$, as if by magic? I have to say, this is by far my favorite of the answers given so far, because it provides such a simple and elegant intuition for why $\sqrt2$ shows up in the solution. But I still don't quite get your answer 100%, so I'd appreciate more explanation in line with the questions above. – Will Nov 2 '19 at 5:27
• @Will I added the missing $x$ to the solution. The reason why $e^{kx}$ works is that the equation is linear with constant coefficient so $e^{kx}$ is a good candidate for a solution because its derivativesf are contant multiples of it. – Mohammad Riazi-Kermani Nov 2 '19 at 6:26
• Thanks again, I moved it inside per your comment – Mohammad Riazi-Kermani Nov 2 '19 at 20:05
• With two complex conjugate solutions you can add them and subtract them to get real solutions. Note that $i$ is a constant that you can drop out . – Mohammad Riazi-Kermani Nov 2 '19 at 21:17

I can't help but remark that jumping to second-order differential equations without even learning about integrals, and to suggest guessing a solution, is an extremely odd way to structure a curriculum. Nevertheless, there is a shortcut way to solve this particular problem. Multiply both sides by $$y'$$ $$y'y'' = -\frac{yy'}{2}$$ Notice, by reversing the chain rule, that this can be rewritten as follows $$\frac{1}{2}(y'^2)' = -\frac{1}{4}(y^2)',$$ This is the equation in "exact derivatives" that can be readily integrated $$y'^2=C_1^2-\frac{1}{2}y^2$$ This can bw solved for $$y'$$ and written as follows $$\frac{d\left(\frac{y}{\sqrt{2}}\right)}{\sqrt{C^2-\left(\frac{y^{2}}{\sqrt{2}}\right)}}=\pm d\left(\frac{x}{\sqrt{2}}\right)$$ which is a standard integral, leading to the solution $$y = \sqrt{2}C_1\sin\left(C_2\pm\frac{x}{\sqrt{2}}\right)$$ If you expand the sine you notice that this is exactly the general solution with $$A=\sqrt{2}C_1\sin{C_2}$$, $$B=\pm\sqrt{2}C_1\cos{C_2}$$. This method is certainly not universally applicable and is no substitute for the general theory of linear equations.

Basically what you want to do is let $$y'' = m^2$$ and -y/2 be -1/2. Substitute that into the equation and solve for m. Any real part of your solution, a, gives you $$Ce^{ax}$$ and any imaginary part b becomes $$C_1 Cos(bx) + C_2Sin(bx)$$ where the C's are constant. You can usually utilize the quadratic formula.

This is a standard technique for solving higher order differential equations. You can use this for any differential equation--when no term of x is in the equation--by letting $$m^{n} = y^{n}$$ and solving for m, where $$y^{n}$$ is the nth derivative.

• Why can we let -y/2 be -1/2? – Will Nov 2 '19 at 20:49