
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Solve the problem: Given $a=\frac{1}{2+\sqrt{3}}$, find the value of $2a^{2}-8a+1$. Xiao Ming analyzed and solved it as follows: Since $a=\frac{1}{2+\sqrt{3}}=\frac{2-\sqrt{3}}{(2+\sqrt{3})(2-\sqrt{3})}=2-\sqrt{3}$, then $a-2=-\sqrt{3}$. Therefore, $\left(a-2\right)^{2}=3$, which means $a^{2}-4a+4=3$. So, $a^{2}-4a=-1$. Hence, $2a^{2}-8a+1=2(a^{2}-4a)+1=2\times \left(-1\right)+1=-1$. According to Xiao Ming's analysis, solve the following problems:  
$(1)$ Calculate: $\frac{1}{\sqrt{2}+1}=$______;  
$(2)$ Calculate: $\frac{1}{\sqrt{2}+1}+\frac{1}{\sqrt{3}+\sqrt{2}}+\frac{1}{\sqrt{4}+\sqrt{3}}+⋯+\frac{1}{\sqrt{40}+\sqrt{39}}$;  
$(3)$ If $a=\frac{1}{\sqrt{5}-2}$, find the value of $a^{2}-4a+1$.

Present the answer in LaTex format: \boxed{Your answer}
user