# Trouble carrying out symbolic operations on matrixes

I have some problems.

First of all, I declare matrices like below

\$Assumptions = {
Element[X, Matrices[{m, n}]],
Element[T, Matrices[{n, k}]],
Element[Y, Matrices[{m, k}]]};


and I want to apply

transpose(X T - Y).(X T - Y) =
transpose[T].transpose[X].X.T - transpose[T].transpose[X].Y -
transpose[Y].X.T + transpose[Y].Y


so I tried

1. Inner[Times, {X \[Transpose]}, {T \[Transpose]}, Plus] - \[Transpose][Y]

2. Inner[NonCommutativeMultiply, {X}, {T}] - {Y} = {-Y + X ** T} ...

But I can not multiply the two above expressions.

Inner[NonCommutativeMultiply,
Inner[Times, {X\[Transpose]}, {T\[Transpose]}, Plus] - Transpose[Y],
Inner[NonCommutativeMultiply, {X}, {T}] - {Y}]


because I get errors. Could you help me?

-

## 1 Answer

Works perfectly well for me. The only thing I see that is wrong is that you forgot the braces for Transpose[Y], so the code should look like this:

Inner[NonCommutativeMultiply,
Inner[Times, {X\[Transpose]}, {T\[Transpose]}, Plus] - {Transpose[Y]},
Inner[NonCommutativeMultiply, {X}, {T}] - {Y}]

-