
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 the function $f(x)=\cos 2x+4\sin x\sin^2\left(\frac{x}{2}+\frac{\pi}{4}\right)$.

$(1)$ The graph of the function $f(2x)$ is translated to the right by $\frac{\pi}{6}$ units to obtain the graph of the function $g(x)$. If $x \in \left[\frac{\pi}{12},\frac{\pi}{2}\right]$, find the range of the function $g(x)$;

$(2)$ In $\triangle ABC$, if $a$, $b$, $c$ are the sides opposite to angles $A$, $B$, $C$ respectively, and it is given that $b=2$, $f(A)=\sqrt{2}+1$, $\sqrt{3}a=2b\sin A$, $B \in \left(0,\frac{\pi}{2}\right)$, find the area of $\triangle ABC$.

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