The nth derivative of $f(x)$ The question is to find $f^{(n)}(x)$ where $f'(x)=g(x)$ and $g'(x)=-f(x)$.
At first glance, both $f(x)$ and $g(x)$ are oscillating functions and should behave like $\sin(x)$ and $\cos(x)$. But how would one express the $n$th derivative in terms of only $f(x)$?
I have a very rudimentary solution from guessing and checking: 
$$f^{(n)}(x)=\sin(n\pi/2)g(x)+\cos(n\pi/2)f(x).$$
I vaguely remember the answer containing either $-1$ or $i$. 
Help is appreciated, thanks. 
 A: If we calculate up to $f^{(4)}(x)$, then we know everything, since $f^{(4)}(x)=f(x)$.  We conclude that $f^{(n)}(x)=f(x)$ if $n$ is congruent to $0$ modulo $4$, and it is equal to $g(x)$ if $n$ is congruent to $1$ modulo $4$, and so on (two more cases). Your formula gives the same result. 
A more interesting question is to identify the functions $f$ and $g$. We will show that there exist numbers $r$ and $\theta$ such that $f(x)=r\sin(x+\theta)$.  
Let $H(x)=f(x)-r\sin(x+\theta)$, where $r$ and $\theta$ are as yet undetermined constants. Then $H''(x)=-H(x)$. The general solution of this differential equation is $A\sin x+B\cos x$.  
If we can manage to choose $r$, $\theta$ so that $f(0)=r\sin(\theta)$ and $f'(0)=g(0)=r\cos(\theta)$, then we will have $H(0)=H'(0)=0$. That forces $A=B=0$, making $H(x)$ identically $0$, and therefore making $f(x)=r\sin(x+\theta)$ for all $x$.  
If $f(0)=g(0)=0$, let $r=0$.  Suppose now that  $f(0)$ and $g(0)$ are not both $0$. Let $r=\sqrt{f^2(0)+g^2(0)}$. There is a unique angle $\theta$ in the interval $[0,2\pi)$  such that $\sin(\theta)=\frac{f(0)}{r}$ and $\cos\theta=\frac{g(0)}{r}$. So we have found $r$, $\theta$ that work.
Thus it turns out that your function $f(x)$ does not  simply behave like the sine function, it basically is the sine function, with a scaling factor $r$ and a shift $\theta$.  
A: This is a standard eigenvalue problem. If we simply sub in for $g(x)$, we have $g'(x) = (f'(x))' = f''(x) = -f(x)$. 
This is a standard second order ODE with constant coefficients, i.e., letting $y = f(x)$, 
$$y'' + y = 0$$
If you know basic differential equations, then you know that the characteristic polynomial for this ODE is
$$\lambda^{2} + 1 = 0,$$ with roots
$$\lambda = \pm i$$
Then we have $f(x) = e^{\pm ix} = \cos x \pm i\sin x$
From here, can you find $f^{n}(x)$?
Note: if you would like to calculate the $n$th derivative in terms of $f(x)$ and $g(x)$, that is possible too; simply note the following:
$f'(x) = g(x); g'(x) = f''(x) = -f(x); f'''(x) = -f'(x) = -g(x); f^{(4)}(x) = f(x)$.
Hence, since we've gotten back to $f(x)$ after four differentiations, we can completely describe $f^{n}(x)$ in terms of $f(x)$ and $g(x)$ based on what $n$ is mod $4$. In this case, we note that your heuristic guess works well, as we want:
$f^{n}(x) = (-1)^{\frac{n-1}{2}}g(x)$ if $n$ is odd
and
$f^{n}(x) = (-1)^{\frac{n}{2}}f(x)$ if $n$ is even
I leave it to you to verify that your guess matches this.
