$\sqrt{x^2-x+1}=\frac{x^3+3x^2-4x+1}{x^2+3}=(x+3)-\frac{7x+8}{x^2+3}$$\Leftrightarrow \frac{7x+8}{x^2+3}+[\sqrt{x^2-x+1}-(x+3)]=0$
$\Leftrightarrow \frac{7x+8}{x^2+3}-\frac{7x+8}{\sqrt{x^2-x+1}+(x+3)}=0$
$\Leftrightarrow (7x+8)(\frac{1}{x^2+3} - \frac{1}{\sqrt{x^2-x+1}+x+3})=0$
$\Leftrightarrow x=-\frac{8}{7}$ hay $\sqrt{x^2-x+1}=x^2-x(1)$
Đặt $t=x^2-x$
(1) thành : $\sqrt{t+1}=t$
$\left\{ \begin{array}{l} t\geq 0\\ t^2-t-1=0 \end{array} \right.$
$\Leftrightarrow t=\frac{1+\sqrt{5}}{2}\Rightarrow x^2-x-\frac{1+\sqrt{5}}{2}=0\Rightarrow x=\frac{1+\sqrt{3+2\sqrt{5}}}{2}$ hay $x=\frac{1-\sqrt{3+2\sqrt{5}}}{2}$
Vậy $x=-\frac{8}{7}$ hay $x=\frac{1+\sqrt{3+2\sqrt{5}}}{2}$ hay $x=\frac{1-\sqrt{3+2\sqrt{5}}}{2}$