
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 $\vec{a} =(m,\sin 2x)$ and $\vec{b} =(\cos 2x,n)$ where $x\in \mathbb{R}$, and let $f(x)= \vec{a}\cdot \vec{b}$. The graph of $f(x)$ passes through the points $(0,1)$ and $\left( \frac{\pi}{4} ,1\right)$.

$(1)$ Find the analytic expression of $f(x)$;  
$(2)$ If $x\in \left[0, \frac{\pi}{2}\right]$, 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