1
$\begingroup$

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 \[Element] Reals && g \[Element] 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.

$\endgroup$
  • 1
    $\begingroup$ A few days ago there was a similar Mathematica question 199009 "How to simplify (square) roots in expressions?" involving Sqrt[u+v*Sqrt[w]]. The answers there may help you here. $\endgroup$ – Somos Jun 5 at 11:33
  • 1
    $\begingroup$ Mathematica seems to ignore the identity (r - Sqrt[-1 + r^2]))]/(r + Sqrt[-1 + r^2])==1 $\endgroup$ – Ulrich Neumann Jun 5 at 12:10
0
$\begingroup$

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

$\endgroup$
  • $\begingroup$ The problem is that per assumptions we have $r>1$ but Mathematica refuses to simplify this expression to $-1$. $\endgroup$ – Roman Jun 5 at 11:17
  • $\begingroup$ 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. $\endgroup$ – AFanthomme Jun 5 at 11:30
  • 1
    $\begingroup$ The plot is made without assumptions, MMA seems to have no problems. $\endgroup$ – Ulrich Neumann Jun 5 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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