Question

# If A and B are n times n matrices. Find the cost of calculating A^2+BAB

Matrices
If A and B are $$n \times n$$ matrices. Find the cost of calculating $$A^2+BAB$$

2020-12-22
Step 1
According to the given information,
It is required to determine the cost of calculating $$A^2+BAB$$
where A and B are $$n \times n$$ matrices.
Step 2
The cost of multiplying two square matrices of order $$n \times n \text{ is } n^3$$
cost of $$A^2=n^3$$
cost of $$BAB=(BA)B$$
cost of $$BAB=n^3+n^3$$
thus,
cost of $$A^3+BAB=n^3+n^3+n^3$$
cost of $$A^3+BAB=3n^3$$