Official solution
Given
\[\int {{e^{\sec x}}\left( {\sec x\tan x\,f(x) + (sec\,x\,tan\,x\, + se{c^2}x)} \right)} \]
\[ = {e^{\sec x}}f(x) + C\]
Differentiating both sides with respect to x,
\[{e^{\sec x}}.\sec x\tan x\,f\left( x \right)\] + \[{e^{\sec x}}\left( {\sec x\tan x + {{\sec }^2}x} \right)\]
= \[{e^{\sec x}}\]. f'(x) + f(x) ({e^{\sec x}}\].\[\sec x\tan x\]
\[ \Rightarrow \] \[{e^{\sec x}}\left( {\sec x\tan x + {{\sec }^2}x} \right)\] = \[{e^{\sec x}}\]. f'(x)
\[ \Rightarrow \] f'(x) = \[{\sec x\tan x + {{\sec }^2}x}\]
\[ \therefore \] \[f(x) = \int {\left( {\left( {\sec x\tan x} \right) + {{\sec }^2}x} \right)dx} \]
\[ \therefore \] \[f(x) = \sec x + \tan x + C\]
From question we can not find the value of C. So we have to choose any random value of C where (\[\sec x + \tan x\]) present.
Only in option D, (\[\sec x + \tan x\]) term present. So only possible option is D.