Step 1: Understand the integrand:
The numerator has two terms and the denominator is \(\cos^{2}x\).
We split the fraction into two parts, because each part is a standard trigonometric form.
Step 2: Split and rewrite:
\[ \frac{1-2\sin x}{\cos^{2}x}=\frac{1}{\cos^{2}x}-2\cdot\frac{\sin x}{\cos^{2}x}=\sec^{2}x-2\sec x\tan x \]
We used \(\frac{1}{\cos x}=\sec x\) and \(\frac{\sin x}{\cos x}=\tan x\).
Step 3: Recall the standard integrals:
\(\int \sec^{2}x\,dx=\tan x\) because \(\frac{d}{dx}(\tan x)=\sec^{2}x\).
\(\int \sec x\tan x\,dx=\sec x\) because \(\frac{d}{dx}(\sec x)=\sec x\tan x\).
Step 4: Integrate term by term:
\[ \int\frac{1-2\sin x}{\cos^{2}x}\,dx=\int\sec^{2}x\,dx-2\int\sec x\tan x\,dx=\tan x-2\sec x+C \]
Step 5: Why the other options are wrong:
Option (B) \(-\tan x+2\sec x+C\) has both signs reversed, so its derivative \(-\sec^{2}x+2\sec x\tan x\) is the negative of the integrand.
Option (C) \(-\tan x-2\sec x+C\) has the derivative \(-\sec^{2}x-2\sec x\tan x\), which does not match.
Option (D) \(\tan x+2\sec x+C\) has the derivative \(\sec^{2}x+2\sec x\tan x\), so the sign of the second term is wrong.
Final Answer:
The integral equals \(\tan x-2\sec x+C\), which is option (A).
\[ \boxed{\tan x-2\sec x+C} \]