As the given matrices A and B are equal, therefore, their corresponding elements must be equal. Comparing the corresponding elements, we get
a + 4 = 2a + 2 3b = b2 + 2
8 = 8 −6 = b2 − 5b
On simplifying, we get
a = 2 and the common value of b = 2.
Hence, the values of a and b are 2, 2.