In the integral $\int \dfrac{\cos 5x+\cos 4x}{1-2\cos 3x}dx$ , the numbers $5$, $4$ and
$3$ are very carefully chosen such that the integrand can be simplified. It is not possible to solve the integral with any $a$, $b$ and $c$ ; instead of some specific carefully choosen $a$, $b$ and $c$.
Now, $$\int \dfrac{\cos 5x+\cos 4x}{1-2\cos 3x}dx = \int \dfrac{(\sin 3x)(\cos 5x+\cos 4x)}{(\sin 3x)(1-2\cos 3x)}dx$$
I have multiplied numerator and denominator by $\sin 3x$ to remove the coefficient "2" of $\cos 3x$ since $2\sin 3x\cos 3x$ would yield $\sin 6x$ (in general, $p$ should be equal to $c$ to remove that "2"). I am removing this "2" to apply the formula of $\sin A - \sin B$, in the hope that, doing similar thing (i.e. applying formula of $\cos A + \cos B$) in numerator would lead to cancellation of some common terms from numerator and denominator (that's exactly what will happen if you notice the solution further).
The cancellation is because of the choice of appropriate angles ($5x,4x$ and $3x$) of sine and cosine. This cancellation would not be possible if the angles are randomly chosen. What I mean to say is that besides having $p$ to be equal to $c$ , $a$ and $b$ should be well chosen so that the integrand can be simplified.
$$\int \dfrac{\cos 5x+\cos 4x}{1-2\cos 3x}dx= \int \dfrac{(\sin 3x)(\cos 5x+\cos 4x)}{\sin 3x-2\sin 3x.\cos 3x}dx$$
$$= \int \dfrac{(\sin 3x)(\cos 5x+\cos 4x)}{\sin 3x-\sin 6x}dx$$
$$= \int \dfrac{(\sin 3x)(\cos 5x+\cos 4x)}{2\cos \frac{9x}{2}.\sin\frac{-3x}{2}}dx$$
$$= \int \dfrac{(\sin 3x)(\require{cancel}\cancel{2} \cancel{\cos \frac{9x}{2}}.\cos \frac {x}{2})}{\cancel{2}\cancel{\cos \frac{9x}{2}}.\sin\frac{-3x}{2}}dx$$
$$= \int \dfrac{(2\cancel{\sin \frac{3x}{2}}.\cos \frac{3x}{2})(\cos \frac{x}{2})}{(-\cancel{\sin \frac{3x}{2}})}dx$$
$$= -\int (2\cos \frac{3x}{2}.\cos \frac{x}{2})dx$$
$$= -\int (\cos 2x+\cos x)dx$$
$$= \int (-\cos 2x-\cos x)dx$$
$$= -\dfrac {\sin 2x}{2} - \sin x + c$$
Best Answer
A standard way for dealing with trigonometric integrals is to exploit the substitution $x=2\arctan\frac{t}{2}$.
Here it leads to $$ \int_{0}^{\pi/2}\frac{\sin^6 x}{\sin x+\cos x}\,dx = 128\int_{0}^{1}\frac{t^6}{(2t+1-t^2)(t^2+1)^6}\,dt$$ and the last integral can be computed by partial fraction decomposition. It equals $$ \frac{1}{8}\left(2+\sqrt{2}\,\text{arctanh}\frac{1}{\sqrt{2}}\right)\approx\frac{28}{69}. $$ This also follows from $\sin x+\cos x=\sqrt{2}\cos\left(x-\frac{\pi}{4}\right)$ and $$ \int_{-\pi/4}^{\pi/4}\frac{\sin^6\left(x+\frac{\pi}{4}\right)}{\sqrt{2}\cos x}\,dx=\frac{1}{8\sqrt{2}}\sum_{k=0}^{6}\binom{6}{k}\int_{-\pi/4}^{\pi/4}\sin^k(x)\cos^{5-k}(x)\,dx $$ where the contribution provided by odd $k$s is zero and $$ 2\int_{0}^{\pi/4}\cos(x)^5\,dx =\frac{43}{30\sqrt{2}},\qquad 2\int_{0}^{\pi/4}\sin(x)^2\cos(x)^3\,dx =\frac{7}{30\sqrt{2}}$$ $$ 2\int_{0}^{\pi/4}\sin(x)^4\cos(x)^1\,dx =\frac{3}{30\sqrt{2}}$$ $$2\int_{0}^{\pi/4}\sin(x)^6\cos(x)^{-1}\,dx =-\frac{73}{30\sqrt{2}}+4\,\text{arctanh}\tan\frac{\pi}{8}.$$