
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) = A\sin(\omega x + \varphi)$ (where $A > 0$, $\omega > 0$, $-\pi < \varphi \leq \pi$) reaches its maximum value of 2 at $x= \frac{\pi}{6}$, and the distance between two adjacent intersections of its graph with the x-axis is $\frac{\pi}{2}$.  
(1) Find the analytical expression of $f(x)$.  
(2) Find the range of the function $g(x) = \frac{6\cos^4x - \sin^2x - 1}{[f(\frac{x}{2} + \frac{\pi}{6})]^2 - 2}$.

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