a) Ta có: \(x^2+x=0\)
\(\Leftrightarrow x\left(x+1\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x=0\\x+1=0\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}x=0\\x=-1\end{matrix}\right.\)
Vậy: \(x\in\left\{0;-1\right\}\)
b) Ta có: \(\left(x-1\right)^{x+2}=\left(x-1\right)^{x+4}\)
\(\Leftrightarrow\left(x-1\right)^{x+2}-\left(x-1\right)^{x+4}=0\)
\(\Leftrightarrow\left(x-1\right)^{x+2}\left[1-\left(x-1\right)^2\right]=0\)
\(\Leftrightarrow\left(x-1\right)^{x+2}\cdot\left[\left(1-x+1\right)\left(1+x-1\right)\right]=0\)
\(\Leftrightarrow\left(x-1\right)^{x+2}\cdot\left(2-x\right)\cdot x=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x-1=0\\2-x=0\\x=0\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}x=1\\x=2\\x=0\end{matrix}\right.\)
Vậy: \(x\in\left\{0;1;2\right\}\)