I have the following code:
COV1 = {{a1,0},{0,a2}}; COV2 = {{b1,0},{0,b2}};
T = MatrixPower[MatrixPower[COV1,1/2],-1]*MatrixPower[MatrixPower[COV1,1/2]*COV2*MatrixPower[COV1,1/2],1/2]*MatrixPower[MatrixPower[COV1,1/2],-1];
Thalf = 1/2*{{1,0},{0,1}} + 1/2*T;
COV3 = Thalf*COV1*Transpose[Thalf]+{{0,t},{t,0}}
d1 = Sqrt[Tr[COV1 + COV2 - 2*MatrixPower[MatrixPower[COV1,1/2]*COV2*MatrixPower[COV1,1/2],1/2]]]
d2 =Sqrt[Tr[COV1 + COV3 - 2*MatrixPower[MatrixPower[COV1,1/2]*COV3*MatrixPower[COV1,1/2],1/2]]]*2
Simplify[d2 - d1]
When I plug in numbers such as
a1 = 5, a2 = 7, b1 = 9, b2 = 45
The last expression evaluates to zero. However when I leave everything as variable, the expresssion doesn't reduce to zero. However, it should. What is going on?
My guess is I need to impose conditions like a1, a2, b1, b2 are strictly positive reals -- but I don't know how to do this.
Also I tried this powerExpand trick I found -- it didn't work (perhaps I used it incorrectly?)
Simplify[d2 - d1, Assumptions -> Element[{a1, a2, b1, b2}, Reals]]
$\endgroup$FullSimplify
andAssumptions->{a1>0, a2>0,b1>0,b2>0}
. $\endgroup$RootReduce[ FullSimplify[(d2 - d1) /. {b1 -> 5, b2 -> 3}, (a1 | a2) \[Element] PositiveReals] /. {a1 -> 4, a2 -> 6} ]
. $\endgroup$