<s>[INST] Complex number in quadratic equation Find $a,b$ given that a root of $x= 1+2i$ and the equation $ x^2+(a+bi)x+2i-1=0$
I tried finding it by $\Delta$,
which I got $\Delta=a^2+2abi-b^2-8i+4$
I tried substituting the root into the equation but still can't continue.
Can you help me?
 [/INST] If you specifically want to do this via the quadratic method (which is not the easiest method as you could use the sum and product of roots to get two expressions that can be solved simultaneously).
But continuing with your method anyway:
Using the quadratic formula for a general quadratic $ax^2+bx+c$ which is
$$x=\frac{-b\pm \sqrt{b^2-4ac}}{2a}$$
$$x=\frac{-a-bi\pm \sqrt{(a+bi)^2-4\cdot 1 \cdot (2i-1)}}{2\cdot 1}$$
Since $x=1+2i$ is a solution
$$\frac{-a-bi\pm \sqrt{(a^2+2abi -b^2-8i+4)}}{2}=1+2i$$
$$\implies{\pm \sqrt{a^2+2abi -b^2-8i+4}}=2+a+(4+b)i$$
$$\implies{{a^2+2abi -b^2-8i+4}}=\left(2+a+(4+b)i\right)^2\tag{1}$$
Now simplify ($1$) and equate for the real and imaginary components to find the value of $a$ and $b$.
</s>