Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7019939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:15:09+00:00 2026-05-27T23:15:09+00:00

I have this matrix a = {{2, -2, -4}, {-2, 5, -2}, {-4, -2,

  • 0

I have this matrix

a = {{2, -2, -4}, {-2, 5, -2}, {-4, -2, 2}}

I then solved an equation with one missing entry. The equation is of the form
Inverse[p].a.p == q
where p is the 3×3 matrix with the missing entry (x5) and q is a given 3×3 matrix.

Solve[Inverse[( {
      {1/Sqrt[5], 4/(3 Sqrt[5]), -2/3},
      {-2/Sqrt[5], 2/(3 Sqrt[5]), -2/6},
      {0, x5, -2/3}
     } )].a.( {
     {1/Sqrt[5], 4/(3 Sqrt[5]), -2/3},
     {-2/Sqrt[5], 2/(3 Sqrt[5]), -2/6},
     {0, x5, -2/3}
    } ) == ( {
    {6, 0, 0},
    {0, 6, 0},
    {0, 0, -3}
   } )]

Mathematica can solve this easily and I get x5 -> -(Sqrt[5]/3) as the result.
However if I check it, the result ist very weird:

In[2]:= Inverse[( {
    {1/Sqrt[5], 4/(3 Sqrt[5]), -2/3},
    {-2/Sqrt[5], 2/(3 Sqrt[5]), -2/6},
    {0, -Sqrt[5]/3, -2/3}
   } )].a.( {
   {1/Sqrt[5], 4/(3 Sqrt[5]), -2/3},
   {-2/Sqrt[5], 2/(3 Sqrt[5]), -2/6},
   {0, -Sqrt[5]/3, -2/3}
  } )

Out[2]= {{6/5 - (2 (-(2/Sqrt[5]) - 2 Sqrt[5]))/Sqrt[5], 
  8/5 + (2 (-(2/Sqrt[5]) - 2 Sqrt[5]))/(3 Sqrt[5]), -(4/Sqrt[5]) + 
   1/3 (2/Sqrt[5] + 2 Sqrt[5])}, {-((
    2 (-(8/(3 Sqrt[5])) + (4 Sqrt[5])/3))/Sqrt[5]) + (
   4/(3 Sqrt[5]) + (4 Sqrt[5])/3)/Sqrt[5], 
  10/3 + (2 (-(8/(3 Sqrt[5])) + (4 Sqrt[5])/3))/(3 Sqrt[5]) + (
   4 (4/(3 Sqrt[5]) + (4 Sqrt[5])/3))/(3 Sqrt[5]), (4 Sqrt[5])/3 + 
   1/3 (8/(3 Sqrt[5]) - (4 Sqrt[5])/3) - 
   2/3 (4/(3 Sqrt[5]) + (4 Sqrt[5])/3)}, {0, 0, -3}}

the expected result should be

( {
  {6, 0, 0},
  {0, 6, 0},
  {0, 0, -3}
 } )

like in the equation. If I calculate this by hand I get this result. What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:15:10+00:00Added an answer on May 27, 2026 at 11:15 pm

    Just Simplify or Expand the results.

    Here is an example:

    In[1]:= a = {{2, -2, -4}, {-2, 5, -2}, {-4, -2, 2}}
    Out[1]= {{2, -2, -4}, {-2, 5, -2}, {-4, -2, 2}}
    
    In[2]:= p = {{1/Sqrt[5], 4/(3 Sqrt[5]), -(2/3)}, {-(2/Sqrt[5]), 2/(
       3 Sqrt[5]), -(2/6)}, {0, x5, -(2/3)}}
    
    Out[2]= {{1/Sqrt[5], 4/(3 Sqrt[5]), -(2/3)}, {-(2/Sqrt[5]), 2/(
      3 Sqrt[5]), -(1/3)}, {0, x5, -(2/3)}}
    
    In[3]:= sol = 
     Solve[Inverse[p].a.p == {{6, 0, 0}, {0, 6, 0}, {0, 0, -3}}]
    
    Out[3]= {{x5 -> -(Sqrt[5]/3)}}
    
    In[4]:= Inverse[p].a.p /. sol[[1]]
    Out[4]= <big output removed>
    
    In[5]:= Simplify[%]
    Out[5]= {{6, 0, 0}, {0, 6, 0}, {0, 0, -3}}
    

    Expand would work too in place of Simplify. Expressions in terms of roots and fractions can often be written in several ways, and it’s not immediately obvious if two expression are equivalent just by looking at them. You have to explicitly ask Mathematica to transform them, for example expr = 13/(2 Sqrt[3]) - 4/3 and Together[expr].


    What is quite strange though, is that Solve does not work if you use the standard syntax and give variables explicitly:

    In[6]:= Solve[Inverse[p].a.p == {{6, 0, 0}, {0, 6, 0}, {0, 0, -3}}, x5]
    
    Out[6]= {}
    
    In[7]:= Solve[
     Inverse[p].a.p == {{6, 0, 0}, {0, 6, 0}, {0, 0, -3}}, x5, 
     VerifySolutions -> False]
    
    Out[7]= {}
    

    Can anyone explain why? NSolve works as expected.

    In[8]:= NSolve[
     Inverse[p].a.p == {{6, 0, 0}, {0, 6, 0}, {0, 0, -3}}, x5]
    
    Out[8]= {{x5 -> -0.745356}}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have this: A * f = g; A: upper triangular matrix (n
I have a function like this: MyFunction(double matrix[4][4]) {/*do stuff*/} I am calling this
I have this problem to solve that I have no idea how to do
I have this matrix: > y [,1] [,2] [,3] [,4] [1,] 1 8 36
If I construct a numpy matrix like this: A = array([[1,2,3],[4,5,6]]) and then type
I have this simple graph: name -> string ^ | v label let matrix
I need some help in this problem I have this matrix in MATLAB: A
I have this code in jQuery, that I want to reimplement with the prototype
I have this idea for a free backup application. The largest problem I need
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.