Solving $C\cos(\sqrt\lambda\theta)+D\sin(\sqrt\lambda\theta)=C\cos(\sqrt\lambda(\theta+2m\pi)) + D\sin(\sqrt\lambda (\theta + 2m\pi))$ 
I want to solve
$$C\cos(\sqrt\lambda \theta) + D\sin(\sqrt\lambda \theta) = C\cos(\sqrt\lambda (\theta + 2m\pi)) + D\sin(\sqrt\lambda (\theta + 2m\pi))$$
The solution must be valid for all $\theta$ in $\mathbb{R}$ and all $m$ in $\mathbb{Z}$, but $C$, $D$, and $\lambda$ are to be determined and can be in $\mathbb{C}$.

The solutions I've found by guessing are $(C\ $arbitrary$, D\ $arbitrary$, \lambda = n^2)$, where $n$ is any integer, and $(C = 0, D = 0, \lambda\ $arbitrary$)$.
Is there some algebra I can do to show that these are the only solutions, or find the rest of the solutions to this equation?
 A: Let $f_{C,D,\lambda}(\theta)
 = C\cos(\sqrt\lambda \theta) + D\sin(\sqrt\lambda \theta).$
Your want the values of the parameters $C,$ $D,$ and $\lambda$ such that
$$ f_{C,D,\lambda}(\theta) = f_{C,D,\lambda}(\theta + 2m\pi) $$
for all $\theta \in \mathbb R$ and all $m \in \mathbb Z.$
In other words, $f_{C,D,\lambda}$ must either be constant or must be non-constant with period $2\pi$ (implying a minimal period that divides $2\pi$).
You found the constant versions of $f_{C,D,\lambda},$ which require either $C=D=0$
or $\lambda = 0.$
For non-constant $f_{C,D,\lambda},$ note that $f_{C,D,\lambda}$ is sinusoidal
with period $2\pi/\sqrt\lambda.$
Hence $2\pi/\sqrt\lambda$ must divide $2\pi,$
hence $\sqrt\lambda$ must be a non-zero integer.
You found those solutions too.
Even if we allow $C,$ $D,$ $\lambda,$ and/or $\theta$ to be complex, $f_{C,D,\lambda}$ is still a single-valued function that is either constant or has period $2\pi/\sqrt\lambda.$
We can write
$$
f_{C,D,\lambda}(\theta) =
\frac12(C-iD)e^{i\sqrt\lambda \theta}
 + \frac12(C+iD)e^{-i\sqrt\lambda \theta}.
$$
For non-constant $f_{C,D,\lambda}$, therefore,
$2\pi/\sqrt\lambda$ must still divide $2\pi$ evenly,
hence $\sqrt\lambda$ must still be a non-zero integer,
and $\lambda$ must still be the square of a non-zero integer,
which gives a set of solutions that you already found.
As far as I can see there are no other solutions.
A: Use the formula $\cos(x) = \frac{e^{ix} + e^{-ix}}{2}$ and  $\sin(x) = \frac{e^{ix} - e^{-ix}}{2i}$. When you substitute this into your expression, on the left-hand side, you would get $ C(\frac{e^{i\sqrt{\lambda}\theta} + e^{-i\sqrt{\lambda}\theta}}{2}) + D(\frac{e^{i\sqrt{\lambda}\theta} - e^{-i\sqrt{\lambda}\theta}}{2i})$. On the right-hand side, you would end up with
$C(\frac{e^{i\sqrt{\lambda}\theta} e^{2\pi mi\sqrt{\lambda}} + e^{-i\sqrt{\lambda}\theta}e^{2\pi mi\sqrt{\lambda}}}{2}) + D(\frac{e^{i\sqrt{\lambda}\theta}e^{2\pi mi\sqrt{\lambda}} - e^{-i\sqrt{\lambda}\theta}e^{2\pi mi\sqrt{\lambda}}}{2i})$. Notice how the right-hand-side is similar to the left-hand side, except of the $e^{2\pi mi\sqrt{\lambda}}$ term. If we set this equal to 1 and solve for $\lambda$, we would see that $\sqrt{\lambda}$ would have to be an integer and therefore making $\lambda = n^2$
This explains the one solution for any C or D value. If you want to find any arbitrary C or D value, I would start by using Euler's formula to turn $C\cos{\sqrt{\lambda}\theta} + D\sin{\sqrt{\lambda}\theta}$ into one function,  and to do the same with the right-hand side.
A: If $C=D=0$, then every $\theta\in\mathbb{R}$ is a solution, since the equation is just $0=0$.
If $D=iC\not=0$, we can divide by $C$ and the equation becomes
$$e^{i\sqrt\lambda\theta}=e^{i\sqrt\lambda(\theta+2m\pi)}$$
the solutions to which must satisfy $\sqrt\lambda\theta=\sqrt\lambda(\theta+2m\pi)+2n\pi$ for some $n\in\mathbb{Z}$, which means we must have $\sqrt\lambda m\in\mathbb{Z}$. This holds for all $m\in\mathbb{Z}$ if and only if $\lambda$ is a square integer.
If $D\not=iC$, then, choosing $\phi\in\mathbb{C}$ so that $\cos\phi=C/\sqrt{C^2+D^2}$ and $-\sin\phi=D/\sqrt{C^2+D^2}$, the equation becomes
$$\cos(\phi+\sqrt\lambda\theta)=\cos(\phi+\sqrt\lambda(\theta+2m\pi))$$
so we must have
$$\phi+\sqrt\lambda\theta=\pm(\phi+\sqrt\lambda(\theta+2m\pi))+2n\pi$$
for some $n\in\mathbb{Z}$. And once again, the only way to have this hold for all $m\in\mathbb{Z}$ is for $\lambda$ to be a sqare integer (in which case the solution with the plus sign is satisfied).
