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.) 
 A: 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.
A: 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.  
A: 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.
