how to decompose a matrix into time invariant and time variant

is it possible to make time invariant and time variant template and then decompose into it

i mean decomposition can be

time invariant matrix + time variant matrix

or

time invariant matrix * time variant matrix

dsolve([Diff(f, t) = f, Diff(f,t) + g = h], f);

dsolve([Diff(f, t) = f, Diff(f,t)*g = h], f);

where h is orthogonal matrix, f,g,h are matrix

would like to find g and f from h

can dsolve solve differential equation of matrix ? how?

dsolve([Diff(f(t), t) = f(t), Diff(f(t),t) + g(t) = h1(x)*h2(x), int(h1(x)*h2(x),x=-1..1) = 0], [f(t),g(t),h1(x),h2(x)]);

dsolve([Diff(f(t), t) = f(t), Diff(f(t),t)*g(t) = h1(x)*h2(x), int(h1(x)*h2(x),x=-1..1) = 0], [f(t),g(t),h1(x),h2(x)]);

assume x^2 + 1 is from interpolation of polynomial

pdsolve([Diff(f(t), t) = f(t), Diff(f(t),t) + g(t) = h1(x,t)*h2(x,t), h1(x,t)*h2(x,t)= x^2+1], [f(t),g(t),h1(x,t),h2(x,t)]);

pdsolve([Diff(f(t), t) = f(t), Diff(f(t),t)*g(t) = h1(x,t)*h2(x,t), h1(x,t)*h2(x,t) = x^2+1], [f(t),g(t),h1(x,t),h2(x,t)]);

these system can not be solved

hope no real number any more after decomposition and only have iinteger in I time invariant function