Abstract matrix multiplication with variables
Using sympy you can do this:
>>> from sympy import *
>>> var('a c d A B')
(a, c, d, A, B)
>>> A = Matrix([[1, 0], [a, c]])
>>> A
Matrix([
[1, 0],
[a, c]])
>>> B = Matrix([[1, d], [0, 1]])
>>> B
Matrix([
[1, d],
[0, 1]])
>>> M = A.multiply(B)
>>> M
Matrix([
[1, d],
[a, a*d + c]])