Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Anomaly or expected behaviour?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61719] Anomaly or expected behaviour?
  • From: "Matt" <anonmous69 at netscape.net>
  • Date: Thu, 27 Oct 2005 05:01:49 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
  In the course of some simple calculations involving the trace and the
determinant of a matrix, I had cause to practice with Mathematica solving the
following:

l1 + l2 = T;
l1 l2 = D;

for l1 and l2.

The answers that Mathematica gave back to me are correct as demonstrated by the
following:

Cell[CellGroupData[{Cell[BoxData[
    RowBox[{"solns", " ", "=", " ",
      RowBox[{"Solve", "[",
        RowBox[{
          RowBox[{"{",
            RowBox[{
              RowBox[{
                RowBox[{
                  SubscriptBox["\[Lambda]", "1"], " ", "+", " ",
                  SubscriptBox["\[Lambda]", "2"]}], " ", "\[Equal]",
                " ", "T"}], ",", " ",
              RowBox[{
                RowBox[{
                  SubscriptBox["\[Lambda]", "1"], " ",
                  SubscriptBox["\[Lambda]", "2"]}], " ", "\[Equal]",
                " ", "D"}]}], "}"}], ",", " ",
          RowBox[{"{",
            RowBox[{
              SubscriptBox["\[Lambda]", "1"], ",",
              SubscriptBox["\[Lambda]", "2"]}], "}"}]}],
        "]"}]}]], "Input",
  CellLabel->"In[151]:="],

Cell[BoxData[
    RowBox[{"{",
      RowBox[{
        RowBox[{"{",
          RowBox[{
            RowBox[{
              SubscriptBox["\[Lambda]", "1"], "\[Rule]",
              RowBox[{
                FractionBox["1", "2"], " ",
                RowBox[{"(",
                  RowBox[{"T", "-",
                    SqrtBox[
                      RowBox[{
                        RowBox[{
                          RowBox[{"-", "4"}], " ", "D"}], "+",
                        SuperscriptBox["T", "2"]}]]}], ")"}]}]}], ",",

            RowBox[{
              SubscriptBox["\[Lambda]", "2"], "\[Rule]",
              RowBox[{
                FractionBox["1", "2"], " ",
                RowBox[{"(",
                  RowBox[{"T", "+",
                    SqrtBox[
                      RowBox[{
                        RowBox[{
                          RowBox[{"-", "4"}], " ", "D"}], "+",
                        SuperscriptBox["T", "2"]}]]}], ")"}]}]}]}],
          "}"}], ",",
        RowBox[{"{",
          RowBox[{
            RowBox[{
              SubscriptBox["\[Lambda]", "1"], "\[Rule]",
              RowBox[{
                FractionBox["T", "2"], "+",
                RowBox[{
                  FractionBox["1", "2"], " ",
                  SqrtBox[
                    RowBox[{
                      RowBox[{
                        RowBox[{"-", "4"}], " ", "D"}], "+",
                      SuperscriptBox["T", "2"]}]]}]}]}], ",",
            RowBox[{
              SubscriptBox["\[Lambda]", "2"], "\[Rule]",
              RowBox[{
                FractionBox["1", "2"], " ",
                RowBox[{"(",
                  RowBox[{"T", "-",
                    SqrtBox[
                      RowBox[{
                        RowBox[{
                          RowBox[{"-", "4"}], " ", "D"}], "+",
                        SuperscriptBox["T", "2"]}]]}], ")"}]}]}]}],
          "}"}]}], "}"}]], "Output",
  CellLabel->"Out[151]="]
}, Open  ]]

However, you'll notice that the display of solns[[1,1]], solns[[1,2]]
and solns[[2,2]] are all similar in their formatting and display, but
in the case of solns[[2,1]], the quantity 1/2 has been distributed into
the parentheses.  Why is that?

$Version
"5.1 for Microsoft Windows (October 25, 2004)"

Thanks,

Matt


  • Prev by Date: MLPutRealList vs. sequence of MLPutDouble
  • Next by Date: Re: Re: Language vs. Library why it matters
  • Previous by thread: Re: Re: MLPutRealList vs. sequence of MLPutDouble
  • Next by thread: Re: Anomaly or expected behaviour?