In the LinearAlgebra packet, I use the command MatrixFunction to calculate a function with respect to a matrix J as follow:

> restart; with(LinearAlgebra);
> J := Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 0, (2, 1) = 0,
(2, 2) = 2, (2, 3) = 1, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2});
> M := MatrixFunction(J, ln(1+x), x);

Then I got the answer:

Matrix(3, 3, {(1, 1) = ln(3), (1, 2) = 1/3, (1, 3) = -1/18, (2, 1) = 0, (2, 2) = ln(3...