To solve this kind of equation, we use the fundamental formula:
Trigonometrical identity, sin2x + cos2 x = 1.
Writing the equation in the form
5sin2 x - 7 sin x cos x + 16 cos2x = 4(sin2 x + cos2 x)
and simplifying, we get
sin2x - 7 sinx cos x + 12cos2x = 0
Dividing by cos2 x on both sides, we get
tan2 x - 7tan x + 12 = 0
Now it can be factorized as
(tanx - 3)(tanx - 4) = 0 ⇒ tan x = 3 or 4