For what values of $a, b$ does the equation
$$
\begin{array}{l}
x^{2}+2(1+a) x+\left(3 a^{2}+4 a b+4 b^{2}\right. \\
+2)=0
\end{array}
$$

have real roots?
$$
\begin{aligned}
\Delta= & 4\left[(1+a)^{2}-\left(3 a^{2}+4 a b+4 b^{2}+2\right)\right] \\
= & 4\left(-1+2 a-2 a^{2}-4 a b-4 b^{2}\right) \\
= & -4\left[\left(1-2 a+a^{2}\right)\right. \\
& \left.+\left(a^{2}+4 a b+4 b^{2}\right)\right] \\
& -4\left[(1-a)^{2}+(a+2 b)^{2}\right] \geqslant 0 . \\
\because & -4\left[(1-a)^{2}+(a+2 b)^{2}\right] \leqslant 0, \\
\therefore & -4\left[(1-a)^{2}+(a+2 b)^{2}\right]=0 .
\end{aligned}
$$

Thus, $1-a=0$, and $a+2 b=0$.
That is, $a=1, b=-\frac{1}{2}$.
Therefore, when $a=1, b=-\frac{1}{2}$, the equation has real roots.