\(A=\sqrt{a^2+6a+9}+\sqrt{a^2-6a+9}\\ =\sqrt{\left(a+3\right)^2}+\sqrt{\left(a-3\right)^2}\\ \\ =a+3+3-a\\ =6\)
\(B=\sqrt{a+2\sqrt{a-1}}+\sqrt{a-2\sqrt{a-1}}\\ =\sqrt{\left(a-1\right)+2\sqrt{a-1}+1}+\sqrt{\left(a-1\right)-2\sqrt{a-1}+1}\\ =\sqrt{\left(\sqrt{a-1}+1\right)^2}+\sqrt{\left(\sqrt{a-1}-1\right)^2}\\ =\sqrt{a-1}+1+1-\sqrt{a-1}\\ =2\)