Note that $$\frac{1}{3 + 4 \tan x} = \frac{\cos x}{3 \cos x + 4 \sin x} = f(x).$$
Next, observe that $$\log (3 \cos x + 4 \sin x) + C = \int \frac{4 \cos x - 3 \sin x}{3 \cos x + 4 \sin x} \, dx = \int g(x) \, dx,$$ via the obvious substitution $u = 3 \cos x + 4 \sin x$. Now the goal is to find a linear combination of the integrands $f$ and $g$ such that for some real-valued scalar constants $A$, $B$, $$A f(x) + B g(x) = 1.$$ Well, this is simple: we have $$A \cos x + B(4 \cos x - 3 \sin x) = 3 \cos x + 4 \sin x,$$ and collecting like terms, we obtain $$A + 4B = 3, \quad -3B = 4,$$ or $$A = \frac{25}{3}, \quad B = -\frac{4}{3}.$$ Therefore, $$x = \int 1 \, dx = \int A f(x) + B g(x) \, dx = A \int f(x) \, dx + B \int g(x) \, dx,$$ or $$\int f(x) \, dx = \frac{3}{25} \left( x + \frac{4}{3} \log (3 \cos x + 4 \sin x) \right) + C,$$ and the rest is trivial.