<s>[INST] Prove that $\frac{(\sin 20^\circ + \cos 20^\circ)^2}{\cos 40^\circ} = \cot 25^\circ$ So I'm trying to come up with an answer to this question for hours now. I don't know what I'm doing wrong and none of the calculators on the internet couldn't help so I figured I should ask people.
What have I done so far:
$\frac{(\sin 20^\circ + \cos 20^\circ)^2}{\cos 40^\circ} = \frac{(\frac{2\sin(45^\circ+20^\circ)}{\sqrt{2}})^2}{\cos 40^\circ} = \frac{\sin^2 65^\circ}{\cos 40^\circ} = \frac{1 - \cos 130^\circ}{\cos 40^\circ} = \frac{1 + \cos 50^\circ}{\cos 40^\circ} = \frac{2\cos^2 25^\circ}{\cos 40^\circ}$ ... etc. 
I can't seem to figure out where to go from here so I'm just stuck.

I also tried the classic approach: 
$\frac{(\sin 20^\circ + \cos 20^\circ)^2}{\cos 40^\circ} = \frac{1 + \sin 40^\circ}{\cos 40^\circ} = \frac{1}{\cos 40^\circ} + {\tan 40^\circ} = \sec 40^\circ + \tan 40^\circ$ 
But how can I prove that
$\sec 40^\circ + \tan 40^\circ = \cot 25^\circ$ ?
What am I doing wrong? Any hints or solutions would be great. Thanks in advance.
 [/INST] Generalization:
$$\dfrac{(\cos x+\sin x)^2}{\cos2x}=\dfrac{(\cos x+\sin x)^2}{\cos^2x-\sin^2x}=\dfrac{\cos x+\sin x}{\cos x-\sin x}$$  provided $\cos x+\sin x\ne0\iff\tan x\ne-1$
Now $$\dfrac{\cos x+\sin x}{\cos x-\sin x}=\dfrac{1+\tan x}{1-\tan x}=\tan\left(45^\circ+x\right)$$
Can you identify $x$ here?
Alternatively,  $$\dfrac{(\cos x+\sin x)^2}{\cos2x}=\dfrac{1+\sin2x}{\cos2x}=\dfrac{1+\dfrac{2\tan x}{1+\tan^2x}}{\dfrac{1-\tan^2x}{1+\tan^2x}}=\cdots=\dfrac{1+\tan x}{1-\tan x}=\cdots$$
</s>