We start by solving the given differential equation:
\[
\frac{dy}{dx} + y \tan x = \sec x
\]
This is a first-order linear differential equation. The integrating factor \( I(x) \) is given by:
\[
I(x) = e^{\int \tan x \, dx} = e^{\log \sec x} = \sec x
\]
Now, multiplying both sides of the differential equation by \( \sec x \), we get:
\[
\sec x \frac{dy}{dx} + y \sec x \tan x = \sec^2 x
\]
The left-hand side is now the derivative of \( y \sec x \):
\[
\frac{d}{dx} \left( y \sec x \right) = \sec^2 x
\]
Integrating both sides:
\[
y \sec x = \int \sec^2 x \, dx = \tan x + c
\]
Thus, the general solution is:
\[
y \sec x = \sec x \, \int \sec x \, dx + c
\]