
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
Given $a>0$, the function $f(x)=-2a\sin(2x+ \frac{\pi}{6})+2a+b$. When $x \in [0, \frac{\pi}{2}]$, we have $-5 \leq f(x) \leq 1$.
(1) Find the constants $a$ and $b$;
(2) When $x \in [0, \frac{\pi}{4}]$, find the maximum and minimum values of $f(x)$ and the corresponding values of $x$.

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