
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)=ae^{x}\cdot\cos x-x\sin x$, and the tangent line to the curve $y=f(x)$ at $(0,f(0))$ is parallel to $x-y=0$.  
$(1)$ Find the value of $a$;  
$(2)$ When $x\in\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, investigate the number of zeros of the function $y=f(x)$, and explain the reason.

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