You clearly have a typo, since there are three equalities in your first line...

Assuming that's actually 3^x + 3^{-x} = \sqrt{b + 1}

(3^x + 3^{-x})^2 = (\sqrt{b + 1})^2

3^{2x} + 2(3^x)(3^{-x}) + 3^{-2x} = b + 1

3^{2x} + 2(1) + 3^{-2x} = b + 1

3^{2x} + 3^{-2x} = b - 1

So the simplification you are given is also incorrect.