I picked an equation $0= x^3 +x^2 -2x -1$ I plotted it with geogebra, to see if it had more than $1$ real root. It definitely cuts the $x$-axis $3$ times.
But when I checked wolfram alpha, to see if its roots could be written exactly(I'm doing A-level maths at school, and I have some C3 coursework to do, and if the value of the root can be found by factorising or something I can't use that equation), it said all three roots were complex (here's a link)
I'm just really confused, I can see that it cuts the $x$-axis $3$ times, but it has imaginary parts in all of its roots.
(although it shows the roots can be written exactly, they're complex enough that I can use the equation)
As suggested in the comments, the apparently complex solutions stem from expressions presumably found using Cardano's Formula to solve the cubic equation. If these solutions are manipulated not via algebraic manipulations, but rather using numerical methods, rounding errors may arise leading to results having small complex parts.
I tried, however, to enter just the equation into Wolfram Alpha without writing solve in front. Then a button appeared saying [Exact forms]. I clicked that button and chose the exact form of $x\approx -1.8$. I copied the exact expression $$ x=-\frac13-\frac{7^{2/3}(1+i\sqrt3)}{3\cdot2^{2/3}\sqrt[3]{1+3i\sqrt3}}-\frac16(1-i\sqrt3)\sqrt[3]{\frac72(1+3i\sqrt3)} $$ into a different instance of Wolfram Alpha and asked it to simplify. A bit down the list of results, I found an alternate form reading $$ x=-\frac13-\sqrt\frac73\sin\left(\frac13\tan^{-1}(3\sqrt3)\right)-\frac13\sqrt7\cos\left(\frac13\tan^{-1}(3\sqrt3)\right) $$ which surely looks real enough.