<s>[INST] Looking for solutions of the following differential equation I obtained the following, apparently clean-looking differential equation, while solving a problem, but cannot find any efficient way to solve it analytically. The equation is of the form,
$$[A - B\cos (q\phi)]y'' + \frac{qB}{2}\sin(q\phi)y' + [C + D\cos(q\phi)]y = 0$$
Where, $q$ is an integer, and $0 \lt \phi \lt 2\pi$, and $y = y(\phi)$. The only boundary condition I know would be, $y(0) = y(2\pi)$.
My first idea for simplifying this was to consider the function to be of the form,$y = G\psi$, and substitute it, to remove the first-order derivative. Taking $F = [A-B\cos(q\phi)]$, this results in $G = \frac{ln F}{4}$ and the modified differential equation looks like,
$$[\frac{F\ddot{F} - \dot{F}^2}{4F} + \frac{\dot{F}^2}{8F} + (C + D\cos(q\phi))ln F]\psi + F\frac{lnF}{4}\ddot{\psi} =0$$
This isn't helpful. Any other ideas, how to tackle this equation? Hints or ideas are welcome. Also, if there is any link to existing literature on this type of equation, please share. I could'nt find any.
 [/INST] Hint.
Making 
$$
\sin t = \sum_{k=0}^N(-1)^k\frac{t^{2k+1}}{(2k+1)!}\\
\cos t = \sum_{k=0}^N(-1)^k\frac{t^{2k}}{(2k)!}\\
y = \sum_{k=0}^N a_k t^k
$$
and substituting into the DE
$$
(\alpha - \cos t)y'' + \frac{\sin t}{2} y' + (\beta + \gamma \cos t)y = 0
$$
we get a set of linear equations in the form
$$
M a = b
$$
like the following (for $N = 7$)
$$
\left(
\begin{array}{cccccccc}
 \beta +\gamma  & 0 & 2 (\alpha -1) & 0 & 0 & 0 & 0 & 0 \\
 0 & \beta +\gamma -\frac{1}{2} & 0 & 6 (\alpha -1) & 0 & 0 & 0 & 0 \\
 -\frac{\gamma }{2} & 0 & \beta +\gamma  & 0 & 12 (\alpha -1) & 0 & 0 & 0 \\
 0 & \frac{1}{12} (1-6 \gamma ) & 0 & \beta +\gamma +\frac{3}{2} & 0 & 20 (\alpha -1) & 0 & 0 \\
 \frac{\gamma }{24} & 0 & \frac{1}{12} (1-6 \gamma ) & 0 & \beta +\gamma +4 & 0 & 30 (\alpha -1) & 0 \\
 0 & \frac{1}{240} (10 \gamma -1) & 0 & -\frac{\gamma }{2} & 0 & \beta +\gamma +\frac{15}{2} & 0 & 42 (\alpha -1) \\
 -\frac{\gamma }{720} & 0 & \frac{1}{360} (15 \gamma -2) & 0 & \frac{1}{6} (-3 \gamma -1) & 0 & \beta +\gamma +12 & 0 \\
 0 & \frac{1-14 \gamma }{10080} & 0 & \frac{1}{240} (10 \gamma -1) & 0 & \frac{1}{12} (-6 \gamma -5) & 0 & \beta +\gamma +\frac{35}{2} \\
\end{array}
\right)\left(
\begin{array}{c}
 a_0 \\
 a_1 \\
 a_2 \\
 a_3 \\
 a_4 \\
 a_5 \\
 a_6 \\
 a_7 \\
\end{array}
\right) = 0
$$
This is a homogeneous linear system with the trivial solution $a = 0$ as expected. So to have a nontrivial solution we need $\det M = 0$ which means that the parameter $\beta$ can be considered as an eigenvalue and the eigenvalues can be obtained by solving
$$
\det M(\beta) = 0
$$
This approach makes it possible to obtain the system's transient response whereas the Fourier series approximation only gives us the response in permanent regime.
</s>