
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)=\frac{1}{3}x^{3}+\frac{1}{2}(2a+1)x^{2}-2(a+1)x$, where $a\in \mathbb{R}$.

$(1)$ If $f(x)$ has a maximum value at $x=1$, find the range of the real number $a$;

$(2)$ If there exists $x\in [1,2]$ such that $f(x)\leqslant 0$, find the range of the real number $a$.

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