1
$\begingroup$

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?)

$\endgroup$
6
  • 2
    $\begingroup$ Simplify[d2 - d1, Assumptions -> Element[{a1, a2, b1, b2}, Reals]] $\endgroup$
    – Sumit
    Commented Sep 8, 2020 at 15:00
  • $\begingroup$ ah, this still didnt work $\endgroup$
    – yoshi
    Commented Sep 8, 2020 at 15:09
  • 1
    $\begingroup$ Your final expression is quite complicated. Perhaps mathematica can't do further simplification. You can try FullSimplify and Assumptions->{a1>0, a2>0,b1>0,b2>0}. $\endgroup$
    – Sumit
    Commented Sep 8, 2020 at 15:13
  • $\begingroup$ ya, i tried fixing 3 variables, (a2 = 3, b1 = 5, b2 = 7) and working with the resulting expression -- it still doesn't simplify to zero $\endgroup$
    – yoshi
    Commented Sep 8, 2020 at 15:40
  • $\begingroup$ @yoshi for a given assignment you can do RootReduce[ FullSimplify[(d2 - d1) /. {b1 -> 5, b2 -> 3}, (a1 | a2) \[Element] PositiveReals] /. {a1 -> 4, a2 -> 6} ]. $\endgroup$
    – flinty
    Commented Sep 8, 2020 at 17:06

1 Answer 1

3
$\begingroup$

Since a1,a2,b1,b2 are all positive, we can substitute them with other numbers $x^2, y^2, z^2, w^2$.

FullSimplify[d2 - d1 /. {a1 -> x^2, a2 -> y^2, b1 -> z^2, b2 -> w^2},
 Element[{x,y,z,w}, PositiveReals]]

(* result: 0 *)
$\endgroup$
2
  • $\begingroup$ i think there's a bracket missing at the end, but ya, thanks! $\endgroup$
    – yoshi
    Commented Sep 8, 2020 at 17:35
  • $\begingroup$ @yoshi thanks, fixed. $\endgroup$
    – flinty
    Commented Sep 8, 2020 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.