# Why Matlab do not respect the exponential matrix property \exp^{YXY^​{-1}}=Y\ex​p^XY^{-1}?

2 views (last 30 days)
Given two square matrices X, Y, with Y invertible, it holds that
,
but when coding it seems not.
For example, given the two matrices
>> X = [1 1 1; 1 1 1; 1 1 1];
>> Y = [1 1 1; 0 1 1; 0 0 1];
Y is invertible as it is full rank.
Defining its inverse as
>> IY = inv(Y)
IY =
1 -1 0
0 1 -1
0 0 1
it is numerically correct.
When checking for the above property a get
>> exp(Y*X*IY)
ans =
20.0855 1.0000 1.0000
7.3891 1.0000 1.0000
2.7183 1.0000 1.0000
>> Y*exp(X)*IY
ans =
8.1548 0 0
5.4366 0 0
2.7183 0 0
Clearly the property does not hold.
What am I missing?

Paul on 6 Oct 2021
The identity holds for the matrix exponential, which is implemented with expm(), not exp() (which is the element-wise exponential function)
X = [1 1 1; 1 1 1; 1 1 1];
Y = [1 1 1; 0 1 1; 0 0 1];
% numerically
expm(Y*X/Y) - Y*expm(X)/Y
ans = 3×3
1.0e+-13 * 0.5684 0.0711 -0.1066 0.3375 0.0355 -0.0711 0.1599 0.0178 -0.0266
% symbolically
expm(sym(Y)*sym(X)*inv(sym(Y))) - sym(Y)*expm(sym(X))*inv(sym(Y))
ans =
Alberto Cavarzeran on 6 Oct 2021
Yes! Thank you very much Paul

Walter Roberson on 5 Oct 2021
Let X and Y be scalar matrices.
syms X Y
lhs = exp(Y * X * inv(Y))
lhs =
rhs = Y * exp(X * inv(Y))
rhs =
eqn = lhs == rhs
eqn =
solve(eqn, X)
ans =
So your proposed equation only holds if X has that particular relationship to Y.
I would suggest to you that your relationship is incorrect.
rhs2 = exp(X * inv(Y))^Y
rhs2 =
eqn2 = lhs == rhs2
eqn2 =
assume(X, 'real')
assume(Y, 'real')
simplify(eqn2)
ans =
symtrue
##### 2 CommentsShowHide 1 older comment
Walter Roberson on 5 Oct 2021
Are you sure it is an identity?
syms X [3 3] real
syms Y [3 3] real
lhs = exp(Y * X * inv(Y))
lhs =
rhs = Y * exp(X) * inv(Y)
rhs =
eqn = lhs - rhs
eqn =
Seqn = simplify(eqn)
Seqn =
x = [1 1 1; 1 1 1; 1 1 1];
y = [1 1 1; 0 1 1; 0 0 1];
subs(Seqn, [X,Y], [x, y])
ans =