2. Given $(a+b i)^{2}=3+4 i$, where $a, b \in \mathbf{R}, i$ is the imaginary unit, then the value of $a^{2}+b^{2}$ is $\qquad$
Answer 5.
Analysis From $(a+b i)^{2}=3+4 i$ we get $|a+b i|^{2}=|3+4 i|$, which means $a^{2}+b^{2}=5$.