Differential equation $d^n/dx^n f(x)=\pm k^2f(x)$ 
How to solve this differential equation:
$$\frac{d^nf(x)}{dx^n}=\pm k^2f(x)$$
For $n=1,2,3$ and $\forall n\in\mathbb{N}$, and both signs, if this is possible.

I encounter these often in physics, with solutions but no derivations. I would like to know how they are solved.
 A: This equation is linear in $f(x)$, so if you just find $n$ linearly independent solutions by wild-guessing it should be enough to prove that this is the general solution of this equation.
For instance, since you know easily that for $n = 1$ you need to substitute $f(x) = e^{rx}$, a wild guess would be the same guess, which leads to 
$$
r^n e^{rx} = \pm k^2 e^{rx} \quad \Longrightarrow \quad r^n = \pm k^2 \quad \Longrightarrow \quad r = \sqrt[n]{\pm k^2} e^{\frac{2\pi i j}n}, \quad 0 \le j \le n-1.
$$
Since all those values of $r$ are distinct, you have $n$ solutions (for a fixed $n^{\text{th}}$ root of $+k^2$ or $-k^2$). Tadam!
Hope that helps,
A: Assume a solution
$$
f\left(x\right) \propto \exp\left(\lambda x\right),
$$
which gives
$$
\lambda^n = \pm k^2.
$$
Now let
$$
\lambda = k^{2/n} \exp\left(i r\right),
$$
so that
$$
\lambda^n = k^2 \exp\left(i n r\right) = \pm k^2 \Rightarrow \exp\left(i n r\right) = \pm 1.
$$
If $+1$,
$$
r_m = \frac{2 \pi}{n} m,
$$
where $m = 0, 1, ..., n - 1$.
If $-1$,
$$
r_m = \frac{\pi}{n} \left(2m+1\right),
$$
where $m = 0, 1, ..., n - 1$.
Your solution is then
$$
f\left(x\right) = \sum_{m=0}^{n-1} a_m \exp\left[k^{2/n} \exp\left(i r_m\right) x\right],
$$
where $a_m$'s are determined with $n$ initial conditions and the correct $r_m$'s are used based on whether it is $+1$ or $-1$.
You can check this for the simple harmonic oscillator ($n = 2$, and the $-1$ case).
