
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
Proposition $p$: The function $f(x)=\log_{3a}\left(\frac{ax}{a-2}\right)$ is decreasing on $(-\infty,0)$; Proposition $q$: The function $f(x)=\sqrt{x^2+4x+5a}$ has the range $[0,+\infty)$.

$(1)$ If $p$ is true, find the range of the real number $a$;

$(2)$ If $p \vee q$ is true and $p \wedge q$ is false, find the range of the real number $a$.

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