<s>[INST] Factorising $x^2-x+1$ I attempted to factorise $x^2-x+1$, which seemed fairly straightforward:
$$ 
\begin{align}
x^2-x+1 &= (x+1)^2-3x \\
        &= (x+1-\sqrt{3x})(x+1+\sqrt{3x}) \\
        &= (x-\sqrt{3x}+1)(x+\sqrt{3x}+1)
\end{align}$$
Technically neither $(x-\sqrt{3x}+1)$ nor $(x+\sqrt{3x}+1)$ are linear functions, which is why I didn't get the "correct" answer:
$$(x-\frac{1}{2}-i\frac{\sqrt{3}}{2})(x-\frac{1}{2}+i\frac{\sqrt{3}}{2})$$
But I am curious as to why Desmos only considers the positive cases of $x$? If $(x-\sqrt{3x}+1)(x+\sqrt{3x}+1)$ does expand perfectly into $x^2-x+1$, why isn't it graphed the same way?
 [/INST] What you propose is not a polynomial factorisation. The polynomial function $x^2-x+1$ is defined for all $x$, whereas your ‘factorisation’ requires $x\ge 0$.
Anyway, since the roots of $x^2+x+1$ are the non-real cubic roots of unity $j$ and $j^2$, the roots of $x^2-x+1$ are $-j$ and $-j^2$n, whence the factorisation
$$x^2-x+1=(x+j)(x+j^2).$$
</s>