# Simplifying an expression involving a matrix and functions of it

I have implemented the following two matrices in Mathematica in order to compute s, but I don't know how I can further simplify the resulting expressions, e.g., Mathematica seems to not perform the trace in the denominator for s. Applying Simplify with the assumption that the $$3$$ variables are positive does not seem to matter much. Below is my attempt:

Q = {{x^2, 0., 0.}, {0., y^2, 0.}, {0., 0., z^2}};
Qhat = Table[
Part[Q, i, j] - KroneckerDelta[i, j]*Tr[Q/3], {i, 3}, {j, 3}] //
MatrixForm
s = (4*Det[Qhat])/(2/3. *(Tr[Qhat^2]))^(3/2)
Simplify[s, x^2 > 0 && y^2 > 0 && z^2 > 0]


Output:

• Don't use MatrixForm to define matrices. It is only a display wrapper and interferes with evaluation. – Roman Apr 30 '19 at 9:04
• @Roman Ah nice spot! that has already made a huge difference, now it evaluates s normally, thanks! Please feel free to post as an answer so I can accept, may be useful for future readers, and in case you also wanted to add something about the simplification. – user52181 Apr 30 '19 at 9:08
• @Roman you should be able to get around that (albeit not producing cleaner or more efficient code) with an Evaluate[] wrapper, yeah? If I am mostly understanding most things, anyways. – CA Trevillian Apr 30 '19 at 9:10

Don't use MatrixForm to define matrices. It is only a display wrapper and interferes with evaluation. See, for example, https://mathematica.stackexchange.com/a/18395/26598