I have a simple matrix expression.
A = ( {
{Subscript[y, 1], 1},
{Subscript[y, 2], 1},
{Subscript[y, 3], 1},
{Subscript[y, 4], 1}
} );
result = Inverse[Transpose[A] . A] . Transpose[A]
When you run this command, you see the following matrix result:
Clearly, it's quite large, but could be massively simplified with a change of variables or two. Such as:
r2 = y_1^2+y_2^2+y_3^2+y_4^2
r1 = y_1 + y_2 +y_3 +y_4
Inspired by this question: How to simplify an expression, using a known term substitution?, I tried using simplify a few different ways that just didn't work:
Simplify[result,
b == Subscript[y, 1] + Subscript[y, 2] + Subscript[y, 3] + Subscript[ y, 4]]
The problem appears to be that Simplify first simplifies the partial fractions, and that leads it down paths where my "simple" substitution becomes difficult/complicated for it to see. Is there a way to have Mathematica rewrite this expression in terms of the individual y's and r1 and r2?