
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 the constant $a\in\mathbb{R}$, and the function $f(x)=a\sin(2x)+2\cos^2(x)$.

(1) If $f(x)$ is an even function, find the value of $a$;

(2) If $f\left(\frac{\pi}{4}\right)=\sqrt{3}+1$, find the solutions to the equation $f(x)=1-\sqrt{2}$ in the interval $[-\pi,\pi]$.

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