Given linear differential equation is
$\frac{d y}{d x}-y \tan x=e^{x} \sec x$
$\therefore $ IF $=e^{-\tan x d x}=e^{-\log \sec x}=\frac{1}{\sec x}$
$\therefore $ Complete solution is
$y \cdot \frac{1}{\sec x}=e^{x} \sec x \cdot \frac{1}{\sec x} d x$
$\Rightarrow \frac{y}{\sec x}=e^{x}+c$
$\Rightarrow y \cos x=e^{x}+c$