I was solving the following trigonometric equation in $x$ (which asked to find the general solution for $x$):
$$\sin x(\cos\frac{x}{4}-2\sin x)+(1+\sin\frac{x}{4}-2\cos x)\cos x=0$$
After simplifying, i got $\sin\frac{5x}{4}=1$ and $\cos x=1$.
So, $x=\frac{(8n+2)\pi}{5}$ and $x=2m\pi$ where $m$ and $n$ are some integers.
How do I find a general solution for $x$ in terms of any integer $k$ using the above 2 equations without trial and error (plugging in m and n to find different values that satisfy)?
From $\cos x=1$ we know than $x$ must be some multiple $m$ of $2\pi$.
From $\sin\left(\frac{5x}{4}\right)=1$ we know that $\frac{5x}{4}$ must be of the form $(4n+1)\frac{\pi}{2}$.
Thus $x$ must be of the form $\left(\frac{4n+1}{5}\right)2\pi$ where $\left(\frac{4n+1}{5}\right)=m$ is an integer.
So it must be the case that $5m-4n=1$.
For a given solution $(m,n)$ it will be the case that $x=2\pi m$ is a solution of $\cos x=\cos (2\pi m)=1$ and $\sin\left(\frac{5x}{4}\right)=\sin\left((4n+1)\frac{\pi}{2}\right)=1$
So all the solutions are of the form $x=2\pi m$ where $m$ is an integer value of $\frac{1+4n}{5}$ for some integer $n$.
Some examples are $x=-6\pi, 2\pi,10\pi,18\pi.\cdots$.
Thus, if $k$ is an integer then $x=2\pi(4k+1)$ is a solution.