1

I have some computation where I specifically define a 2x2 matrix to have a specific eigenvector v associated with an eigenvalue g, and a second eigenvalue l :

$Assumptions = r > 1 && g > 0 && r ∈ Reals && g ∈ Reals;
v = {r - Sqrt[-1 + r^2], 1};
Mat[l_, t_] := {{t, (g - t) (r - Sqrt[-1 + r^2])}, {(t - l)/(r - Sqrt[-1 + r^2]), g + l - t}};
Simplify[Mat[l, t].v]

The output of this is, as expected :

{g (r - Sqrt[-1 + r^2]), g}

Thus, given that the trace is l+g and g is an eigenvalue, the problem should be solved. However, when I ask the eigenvalues of this, I get:

{1/2 (g + l - Sqrt[(g - l)^2 (-1 + 2 r (r - Sqrt[-1 + r^2]))]/(-r + Sqrt[-1 + r^2])), 
1/2 (g + l + Sqrt[-(g - l)^2 (1 + 2 r (-r + Sqrt[-1 + r^2]))]/(-r + Sqrt[-1 + r^2]))}

EDIT : As pointed out by Roman, this is a simple problem of Mathematica not being able to simplify the expression

Sqrt[ (-1 + 2 r (r - Sqrt[-1 + r^2]))]/(-r + Sqrt[-1 + r^2])

to -1 for r > 1. Still interested in knowing why it is so, but not a linear algebra issue.

AFanthomme
  • 11
  • 3

2 Answers2

1

just as extended comment:

The plot

Plot[Sqrt[(-1 + 2 r (r - Sqrt[-1 + r^2]))]/(-r +Sqrt[-1 + r^2]), {r, -5, 5}]

enter image description here

makes no problems (MMA v11.0.1)! Please clarify your question

Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55
  • The problem is that per assumptions we have $r>1$ but Mathematica refuses to simplify this expression to $-1$. – Roman Jun 05 '19 at 11:17
  • I used much larger r (e.g. in [1, 500]). It is a numerical approximation issue, not surprising and just a symptom of not having simplified to -1. – AFanthomme Jun 05 '19 at 11:30
  • 1
    The plot is made without assumptions, MMA seems to have no problems. – Ulrich Neumann Jun 05 '19 at 12:08
1

If you use Surd (which gives the real-valued square root) instead of Sqrt then you get the desired simplification:

v = {r - Surd[-1 + r^2, 2], 1};
Mat[l_, t_] := {{t, (g - t) (r - Surd[-1 + r^2, 2])}, {(t - l)/(r - 
               Surd[-1 + r^2, 2]), g + l - t}};

Eigenvalues[Mat[l, t]]
{g, l}
bill s
  • 68,936
  • 4
  • 101
  • 191