title: Why doesn't backsubstituting the result of Solve[] give the expected result?
body: <p>I have this matrix </p>
  
  <pre><code>a = {{2, -2, -4}, {-2, 5, -2}, {-4, -2, 2}}
  </code></pre>
  
  <p>I then solved an equation with one missing entry. The equation is of the form
  Inverse[p].a.p == q
  where p is the 3x3 matrix with the missing entry (x5) and q is a given 3x3 matrix.</p>
  
  <pre><code>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}
     } )]
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>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}}
  </code></pre>
  
  <p>the expected result should be </p>
  
  <pre><code>( {
    {6, 0, 0},
    {0, 6, 0},
    {0, 0, -3}
   } )
  </code></pre>
  
  <p>like in the equation. If I calculate this by hand I get this result. What am I missing here?</p>