
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
Let $a$ be a constant, and $f\left(x\right)=a\sin 2x+2\cos ^{2}x$.  
$(1)$ If $f\left(x\right)$ is an even function, find the value of $a$.  
$(2)$ If $f(\frac{π}{4})=\sqrt{3}+1$, find the solutions of the equation $f\left(x\right)=1-\sqrt{2}$ in the interval $\left[-\pi ,\pi \right]$.

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