To evaluate the integral
\[
\int \frac{3 - 2 \cot^2 x}{\cos^2 x} \, dx,
\]
we can break it down step-by-step.
### Step 1: Rewrite the integral
We can rewrite the integral by separating the terms in the numerator:
\[
\int \frac{3}{\cos^2 x} \, dx - 2 \int \frac{\cot^2 x}{\cos^2 x} \, dx.
\]
### Step 2: Use trigonometric identities
Recall that \(\frac{1}{\cos^2 x} = \sec^2 x\) and \(\cot^2 x = \frac{\cos^2 x}{\sin^2 x}\). Thus, we can rewrite the second integral:
\[
\int \frac{3}{\cos^2 x} \, dx - 2 \int \frac{\cot^2 x}{\cos^2 x} \, dx = \int 3 \sec^2 x \, dx - 2 \int \cot^2 x \sec^2 x \, dx.
\]
### Step 3: Integrate the first term
The integral of \(\sec^2 x\) is a standard integral:
\[
\int 3 \sec^2 x \, dx = 3 \tan x + C_1.
\]
### Step 4: Integrate the second term
For the second integral, we can use the identity \(\cot^2 x = \csc^2 x - 1\):
\[
\int \cot^2 x \sec^2 x \, dx = \int (\csc^2 x - 1) \sec^2 x \, dx = \int \csc^2 x \sec^2 x \, dx - \int \sec^2 x \, dx.
\]
The integral of \(\sec^2 x\) is already calculated. The integral of \(\csc^2 x\) is:
\[
\int \csc^2 x \, dx = -\cot x + C_2.
\]
Thus, we have:
\[
\int \cot^2 x \sec^2 x \, dx = \int \csc^2 x \sec^2 x \, dx - \tan x.
\]
### Step 5: Combine results
Now we can combine the results:
\[
\int \frac{3 - 2 \cot^2 x}{\cos^2 x} \, dx = 3 \tan x - 2 \left(-\cot x - \tan x\right) + C,
\]
which simplifies to:
\[
3 \tan x + 2 \cot x + 2 \tan x + C = 5 \tan x + 2 \cot x + C.
\]
### Final Answer
Thus, the final answer is:
\[
\int \frac{3 - 2 \cot^2 x}{\cos^2 x} \, dx = 5 \tan x + 2 \cot x + C.
\]