For integrals of the form \( \int \frac{A f(x) + B f'(x)}{C f(x) + D f'(x)} dx \) or more specifically \( \int \frac{a\cos kx + b\sin kx}{p\cos kx + q\sin kx} dx \), assume:
Numerator \( = L \cdot (\text{Denominator}) + M \cdot (\text{Derivative of Denominator}) \).
Solve for \(L\) and \(M\) by comparing coefficients.
The integral then becomes \( \int (L + M \frac{\text{Derivative}}{\text{Denominator}}) dx = Lx + M \log|\text{Denominator}| + C \).