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.
 A: First, we simplify the equation by introducing a new variable $q \phi=t$:
$$[A - B\cos t]y'' + \frac{B}{2}(\sin t) y' + \frac{1}{q^2} [C + D\cos t]y = 0$$
We can also reduce the number of parameters:
$$[\alpha - \cos t]y'' + \frac{\sin t}{2} y' + [\beta + \gamma \cos t]y = 0$$
Where $\alpha=\frac{A}{B}, \beta=\frac{C}{q^2 B}, \gamma=\frac{D}{q^2 B}$.
Because of periodicity, we can expand the function as a Fourier series:
$$y(t)=\sum_{n=-\infty}^\infty a_n e^{ i n t }$$
Substituting:
$$\sum_{n=-\infty}^\infty a_n \left(- n^2 (\alpha - \cos t) + \frac{i n}{2} \sin t  + [\beta + \gamma \cos t] \right) e^{ i n t } = 0$$
Now we multiply by $\frac{1}{2 \pi} e^{-i m t}$ and integrate from $0$ to $2\pi$ and get a system of linear equations:
$$\sum_{n=-\infty}^\infty a_n \left(- \alpha n^2 \delta_{nm}  + n^2 I_{nm} + \frac{i n}{2} J_{nm}  + \beta \delta_{nm} + \gamma I_{nm} \right) = 0$$
Where:
$$I_{nm}=\frac{1}{2 \pi} \int_0^{2\pi} \cos t ~e^{i (n-m) t} dt=\frac{1}{2} (\delta_{n+1,m}+\delta_{n-1,m})$$
$$J_{nm}=\frac{1}{2 \pi} \int_0^{2\pi} \sin t ~e^{i (n-m) t} dt=\frac{1}{2i} (\delta_{n+1,m}-\delta_{n-1,m})$$
So we obtain a tridiagonal system of linear equations:
$$\sum_{n=-\infty}^\infty a_n \left((\beta- \alpha n^2) \delta_{nm}  + \frac{2n^2+n+2\gamma}{4} \delta_{n+1,m} + \frac{2n^2-n+2\gamma}{4} \delta_{n-1,m}  \right) = 0$$
For an approximate solution we need to truncate it at some large $N$. As for an analytical solution, I'm not sure it exists, but maybe there are more advanced methods to search for it.
A: 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.
