
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$, $a \neq 1$ and $\log_{a}3 < \log_{a}2$, if the function $f(x)=\log_{a}x$ has a difference of $1$ between its maximum and minimum values in the interval $[a,3a]$.  
$(1)$ Find the value of $a$;  
$(2)$ If $1 \leqslant x \leqslant 3$, find the range of the function $y=(\log_{a}x)^{2}+\log_{a}\sqrt{x}-2$.

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