Finding max and min from polynomial equation 
Let $a, b \in \mathbb R$ and $b \geqslant 0$. Given that $x^4 + ax^2 + b = 0$ has $2$ real solutions, find maximum for $|a-b|$ and minimum for $a+2b$.

My solution :
$$x^4+ax^2+b=0 \implies (x^2-c)(x^2-d) = 0$$
there is only 1 case which is possible,that is, both $c$ and $d$ are positive
so $x^2=c$ and $x^2 = d$
if it has 2 real solutions, then $c = d$ ($x=\pm\sqrt c$  and   $ x=\pm\sqrt d$). So we get $a=-2c$ , $b=c^2$
$$|a-b|=|-2c-c^2|=c^2+2c+1-1=(c+1)^2-1$$
but I can't find max.
$$a+2b = 2c^2-2c = 2(c-\frac{1}{2})^2-\frac{1}{2}\implies \min = -\frac{1}{2}$$
But I think my method is wrong because I can't solve for $\max$.

If $b=0$ and $a\geq 0$ then  $x^4+ax^2+b=0$ has just one real root, i.e. $x=0$.
If $b=0$ and $a< 0$ then  $x^4+ax^2+b=0$ has three real roots, i.e. $x=0, \pm\sqrt{-a}$
If $b>0$ then $x^4+ax^2+b=0$ has two distinct real roots iff $z^2+az+b=0$ has one positive root and a negative root, which is impossible because $b>0$, or two coincident positive roots that is when $\Delta=a^2-4b=0$ and $a<0$.
Hence for $b=a^2/4$ with $a<0$ we have that $|a-b|=|a-a^2/4|$ has supremum $+\infty$, whereas $a+2b=a+a^2/2=\frac{(a+1)^2-1}{2}$ has minimum value $-1/2$, attained for $a=-1$.
