
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)=(ax^2+x+a)e^{-x}$ $(a\in \mathbb{R})$.

$(1)$ If $a\geqslant 0$, the maximum value of the function $f(x)$ is $\frac{3}{e}$, find the value of the real number $a$;

$(2)$ If for any $a\leqslant 0$, $f(x)\leqslant b\ln(x+1)$ holds true for all $x\in [0,+\infty)$, find the range of the real number $b$.

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