I had a test where I was asked this question. I integrated the function by taking $\tan x=u$ and then $\sec^2x \, dx=du$. I took $\sec(x) =\sqrt{1+u^2}$ and then using the basic formulas calculated the correct answer but my teacher didn't give me marks for my solution. Please explain me why. He gave me a zero.I can't post pictures otherwise I would have shown you
I got the answer $(\tan x\sec x-\log(\tan x+\sec x)/2$
Here the picture of my solution https://drive.google.com/file/d/1E9e1JoX_8C28h7k8uW6bBpoYZFy1LuCM/view?usp=drivesdk