0
$\begingroup$

So I have this matrix I am working with that looks like $$S=\begin{pmatrix}0 & -a & b\\ a & 0 & -c\\ -b & c& 0 \end{pmatrix} $$ and upon asking mathematica for the eigenvalues I get Eigenvlaues[S] $=0, \sqrt{-a^2+-b^2+-c^2},-\sqrt{-a^2+-b^2+-c^2} $. Yes the eigenvalues are imaginary, but why doesn't it simplify it to be imaginary, and how can I force it to replace those minus sines and slap an $i$ in there instead? When I go to find the Eigenvectors does it recognize the terms I have as imaginary eigenvalues and simplify as such, or do I need to force it somehow.

$\endgroup$
6
  • 3
    $\begingroup$ People here generally like users to post code as Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find the meta Q&A, How to copy code from Mathematica so it looks good on this site, helpful. -- Also, keep in mind a, b, and c are treated as complex numbers. -- Finally, something like this might work: PowerExpand[Sqrt[-a^2]] $\endgroup$
    – Michael E2
    May 30, 2022 at 22:59
  • $\begingroup$ Oh wow I didn't know that! Okay thank you for the heads up. Could I just make the assumption in the code that a,b,c are all real? $\endgroup$
    – Joey
    May 30, 2022 at 23:02
  • 1
    $\begingroup$ Try ComplexExpand. $\endgroup$ May 30, 2022 at 23:04
  • 2
    $\begingroup$ Compare: Simplify[Sqrt[-a^2 - b^2], a > 0 && b > 0], Simplify[Sqrt[-a^2 - b^2], a >= 0 && b >= 0], Simplify[Sqrt[-a^2 - b^2], {a, b} \[Element] Reals], Simplify[Sqrt[-a^2 - b^2], a != 0 && b != 0 && {a, b} \[Element] Reals] -- That the case a == b == 0 seems important here looks like a weakness of Mathematica. It probably does not check whether the expression under the radical can change sign or not, probably for efficiency's sake. $\endgroup$
    – Michael E2
    May 30, 2022 at 23:14
  • 1
    $\begingroup$ Mma seems to want to treat 0 as a non-imaginary number and keep it separate from the (nonzero) imaginary numbers: Assuming[a^2 + b^2 >= 0, FullSimplify@PiecewiseExpand@ComplexExpand[Sqrt[-a^2 - b^2]] ] $\endgroup$
    – Michael E2
    May 30, 2022 at 23:28

0

Your Answer

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

Browse other questions tagged or ask your own question.