Solving a simple second order ODE with initial condition Okay i've been at it for far too long now. It comes from a bigger question from working with a PDE. I did seperation of variables and now I am stuck near the end of the problem. Here is the ODE in question
$$ \Phi''(y)= \lambda^2\cdot\Phi(y)$$ with the following initial condition
$$ \Phi'(H)=0$$ where $H$ is a positive number. Also I know $\displaystyle \lambda = \frac{n\pi}{L} >0$. There is another condition but I dont think it can help 
$$ \Phi(0) = \begin{cases} 0  & x > L/2  \\ 1 & x < L/2 \end{cases}$$
sorry, i dont know how to do cases in latex and yes, that is an $x$ in the initial condition. Like i said this is a bigger problem that has both x and y. 
The solution should be $$\Phi(y) = B \cdot \cosh{(\lambda(H-y))}$$
I've tried going through the following general solutions
$$\Phi(y) = Ae^{\lambda y} + B e^{-\lambda y}$$ and
$$\Phi(y) = A \sinh{\lambda y} + B \cosh{\lambda y}$$
but no luck that way :(
 A: The forms $Ae^{\lambda y} + Be^{-\lambda y}$ and $D \cosh(\lambda(C - y))$ are really different ways of writing the same thing. For
$$Ae^{\lambda y} + Be^{-\lambda y} = \sqrt{AB} ( \sqrt{A \over B} e^{\lambda y} + \sqrt{B \over A} e^{-\lambda y})$$
$$ = \sqrt{AB} ({ e^{\lambda y + {1 \over 2}\ln({A \over B})} + e^{-\lambda y - {1 \over 2}\ln({A \over B})}})$$
Letting $C = -{1 \over 2\lambda}\ln{A \over B}$, this becomes 
$$\sqrt{AB} ( e^{\lambda y - \lambda C}+ e^{-\lambda y + \lambda C})$$
$$=2\sqrt{AB} \cosh(\lambda(y - C)) = 2\sqrt{AB} \cosh(\lambda(C - y)) $$
Thus letting $D = 2\sqrt{AB}$ you get the other form. Plug in your initial condition to show $C = H$.
A: It is probably easiest just to remember as a general fact that 
$$f(x)=\begin{cases}A\cosh(\lambda(x-H)) & A, H\in\mathbb R\\
A\sinh(\lambda(x-H)) & A, H\in\mathbb R\\
e^{\lambda(x-H)} & H\in\mathbb R\\
e^{-\lambda(x-H)} & H\in\mathbb R\end{cases}$$
are a complete set of solutions to $f''=\lambda^2f$ in general. To remember that they are solutions, just note that since the ODE does not mention the independent variable we can slide any known solution to the left and right. Proving them complete is slightly more involved -- one strategy would be to show that together they cover all possible pairs of $f(0), f'(0)$, by case analysis on their logarithmic derivatives.
Then, since you're already given a $H$ such that $f'(H)=0$ you can immediately see that it must be of the form $A\cosh(x-H)$ for some $A$, since the other forms have no stationary points. Finding $A$ such that your condition for $\Phi(0)$ holds is then a simple matter of scaling.
