When $a, b$ take what values, the equation
$$
x^{2}+2(1+a) x+\left(3 a^{2}+4 a b+4 b^{2}+2\right)=0
$$

has real roots?
Solution 1: After multiplying both sides of the known equation by 2, we can complete the square as follows:
$$
\left(x^{2}+4 x+4\right)+\left(x^{2}+4 a x+4 a^{2}\right)+2\left(a^{2}+4 a b+4 b^{2}\right)=0 \text {, }
$$

which is $(x+2)^{2}+(x+2 a)^{2}+2(a+2 b)^{2}=0$,
By the property of non-negative numbers, we have
$$
x+2=0, x+2 a=0, a+2 b=0 .
$$

Thus, $x=-2, a=1, b=-\frac{1}{2}$.
Therefore, when $a=1, b=-\frac{1}{2}$, the original equation has real roots.
Solution 2: Since the equation has real roots, the discriminant is
$$
\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)+\left(a^{2}+4 a b+4 b^{2}\right)\right] \\
& =-4\left[(1-a)^{2}+(a+2 b)^{2}\right] \geqslant 0,
\end{aligned}
$$

Since $-4\left[(1-a)^{2}+(a+2 b)^{2}\right] \leqslant 0$,
we have $-4\left[(1-a)^{2}+(a+2 b)^{2}\right]=0$.
Thus, $1-a=0$, and $a+2 b=0$,
which means $a=1, b=-\frac{1}{2}$.
Therefore, when $a=1, b=-\frac{1}{2}$, the equation has real roots.