Example 3. For what values of $a, b$ does the equation $x^{2}+2(1+a) x$ $+\left(3 a^{2}+4 a b+4 b^{2}+2\right)=0$ have real roots?
(1987, National Junior High School Mathematics Competition)
The condition for the equation to have real roots is
$$
\begin{aligned}
\Delta & =(2+2 a)^{2}-4\left(3 a^{2}+4 a b+4 b^{2}+2\right) \\
& =-4\left[(1-a)^{2}+(a+2 b)^{2}\right] \geqslant 0 .
\end{aligned}
$$

Clearly, $-4\left[(1-a)^{2}+(a+2 b)^{2}\right]=0$.
Then $1-a=0$ and $a+2 b=0$,
i.e., when $a=1$ and $b=-\frac{1}{2}$, the original equation has real roots.