# Symbolic matrix simplification and solving

I am trying to expand or solve an equation that contains matrices for a certain matrix, but it is not working:

\$Assumptions =
{Element[X, Vectors[n]], Element[Zu, Vectors[n]],
Element[Fu, DiagonalMatrix[n]], Element[Y, Matrices[{n, n}, Reals]]};

Solve[Y.Fu.(Zu + X.Y) + (Zu + X.Y).Fu.Y + 2 λ X == 0, X]

ExpandAll[Y.Fu.(Zu + X.Y) + (Zu + X.Y).Fu.Y + 2 λ X]

Simplify[Y.Fu.(Zu + X.Y) + (Zu + X.Y).Fu.Y + 2 λ X]


None of the above inputs works. Am I doing something wrong or is it that Mathematica cannot solve for matrix equation symbolically?

-
Anyway, Mathematica still lacks proper matrix symbolic manipulation, except for some basic stuff. You, me and many others are hoping it comes soon – Rojo Jan 30 '14 at 2:28

Here is one way to proceed:

n = 3;
xvec = Array[x, n];
zvec = Array[z, n];
ymat = Array[y, {n, n}];
fumat = DiagonalMatrix[Array[fu, n]];

Solve[ymat.fumat.(zvec + xvec.ymat) + (zvec + xvec.ymat).fumat.ymat + 2 lam*xvec == 0, xvec]


The output is a fully symbolic answer for the terms of xvec, albeit not in as compact a form as one might wish.

The Assumptions command does not work as you wish. In particular, assumptions are not carried over from the first line to the later lines of your code. You can see this by looking at the FullForm of your variables.

-
Thank you very much I had already seen a similar answer, but I was looking if there is any way to gather them in matrices again? – Yannis Assael Jan 30 '14 at 2:18
I guess the only hope would be to try something in the Tensor commands: reference.wolfram.com/language/tutorial/SymbolicTensors.html – bill s Jan 30 '14 at 2:30
Thanks but it uses assumptions I though the were the right case. Could you please give me an example of how this would work in my case or a similar one? – Yannis Assael Jan 30 '14 at 2:55
The difficulty is that there is no TensorSolve and regular commands (like Solve) don't honor the tensor assumptions. I have never used these commands. Maybe someone else has figured it out. – bill s Jan 30 '14 at 3:23