\(\left(x-1\right)^{x+2}=\left(x-1\right)^{x+6}\)
\(\Leftrightarrow\left(x-1\right)^{x+6}-\left(x-1\right)^{x+2}=0\)
\(\Leftrightarrow\left(x-1\right)^{x+2}\left[\left(x-1\right)^4-1\right]=0\)
\(\Leftrightarrow\orbr{\begin{cases}\left(x-1\right)^{x+2}=0\\\left(x-1\right)^4=1\end{cases}}\)
\(\Leftrightarrow x-1=0\left(h\right)x-1=1\left(h\right)x-1=-1\)
\(\Leftrightarrow x=1\left(h\right)x=2\left(h\right)x=0\)
Vậy \(x\in\left\{0;1;2\right\}\)