<s>[INST] Solve $\sqrt{2}\sec x+\tan x=1$ 
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 ?
 [/INST] HINT
As noticed we can't use differentiation to obtain the result indeed in general
$$f'(x)=g'(x) \not \Rightarrow f(x)=g(x)$$
consider for example the simple case
$$2x+3=1 \to 2=0$$
I suggest to use tangent half-angle identities by $t = \tan \frac x2$ to obtain
$$\sqrt{2}\sec x+\tan x=1 \iff \sqrt{2}\frac{1+t^2}{1-t^2}+\frac{2t}{1-t^2}=1$$
</s>