$ \frac{5}{\cos^2x} = 7\tan x + 3 $ Prelude
I was reading a trigonometry textbook, and came across the following problem.

Problem
$ \frac{5}{\cos^2x} = 7\tan x + 3 $

Attempt
$ \frac{5}{\cos^2x} = 7\tan x + 3 $
$ \frac{5}{\cos^2x} = 7\frac{\sin x}{\cos x} + 3 $
$ 5 
= \cos^2x(7\frac{\sin x}{\cos x} + 3) 
= \cos x(7\sin x + 3\cos x)
= \sqrt{7^2+3^2}\cos x(\frac{7}{\sqrt{7^2+3^2}}\sin x + \frac{3}{\sqrt{7^2+3^2}}\cos x)
= \sqrt{58}\cos x(\frac{7}{\sqrt{58}}\sin x + \frac{3}{\sqrt{58}}\cos x) 
= \sqrt{58}\cos x(\cos (\arctan{\frac{3}{7}})\sin x + \sin (\arctan{\frac{3}{7}}) \cos x) 
= \sqrt{58}\cos x\sin(x +\arctan{\frac{3}{7}})$
$ \cos x\sin(x +\arctan{\frac{3}{7}}) = \frac{5}{\sqrt{58}} $
My attempt is the polar opposite of elegant, and I never even come to the solution.

Postscript
The book is "Trigonometry" by I. M. Gelfand.
You can find the problem under Chapter 9: Inverse Functions and Trigonometric Equations; Section 6: More complicated trigonometric equations; Problem 11.

hint: $\dfrac{1}{\cos^2 x} = \sec^2 x = \tan^2 x + 1$. This substitution takes you back to a quadratic equation in $\tan x$.
