
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 $f\left(x\right)=x^{2}+x+a^{2}+a$, $g\left(x\right)=x^{2}-x+a^{2}-a$, and the domain of functions $f\left(x\right)$ and $g\left(x\right)$ is $R$. Let $M\left(x\right)$ represent the larger of $f\left(x\right)$ and $g\left(x\right)$, denoted as $M\left(x\right)=\max \{f\left(x\right),g\left(x\right)\}$.

$(1)$ If $a=1$, write down the analytical expression of $M\left(x\right)$ and find the minimum value of $M\left(x\right)$.

$(2)$ If the minimum value of the function $M\left(x\right)$ is $3$, find the value of the real number $a$.

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