Solve $\sqrt{2}\sec x+\tan x=1$
I understand it can be very easily solved by expanding in terms of $\sin x$ and $\cos x$, gives $x=2n\pi-\frac{\pi}{4}$. But, what if I do the following: $$ \sqrt{2}\sec x+\tan x=1\\ \text{Differentiating}\implies\sqrt{2}\sec x\tan x+\sec^2 x=0\implies\sqrt{2}\tan x+\sec x=0 $$ Step 1 $$ \sec x=-\sqrt{2}\tan x=\frac{1-\tan x}{\sqrt{2}}\implies2\tan x=\tan x-1\implies\tan x=-1\\ \boxed{x=n\pi-\frac{\pi}{4}} $$ Step 2 $$ \tan x=1-\sqrt{2}\sec x=\frac{-\sec x}{\sqrt{2}}\implies2\sec x-\sqrt{2}=\sec x\\ \implies\sec x=\sqrt{2}\implies\boxed{x=2n\pi\pm\frac{\pi}{4}} $$ $$ x=n\pi-\frac{\pi}{4}\quad\&\quad x=2n\pi\pm\frac{\pi}{4}\\\implies \bigg[x=2n\pi-\frac{\pi}{4}\text{ or }x=2n\pi+\frac{3\pi}{4}\bigg]\quad\&\quad x=2n\pi\pm\frac{\pi}{4}\\ \implies \boxed{x=2n\pi-\frac{\pi}{4}} $$ In my attempt why do I need Step 2 to get the complete solution ?
Can someone give a proper explanation to my attempt ?