Stack Exchange
Hash in the output of a cell
I am just getting started with this and I am trying to diagonalize a matrix symbolically. I have have this code:
A = {{0, a, 0}, {a, b, c}, {0, c, d}}
DiagonalMatrix[Eigenvalues[A]]

And this is my output:
{{Root[a^2 d + (-a^2 - c^2 + b d) #1 + (-b - d) #1^2 + #1^3 &, 1], 0, 
  0}, {0, 
  Root[a^2 d + (-a^2 - c^2 + b d) #1 + (-b - d) #1^2 + #1^3 &, 2], 
  0}, {0, 0, 
  Root[a^2 d + (-a^2 - c^2 + b d) #1 + (-b - d) #1^2 + #1^3 &, 3]}}

I understand that # is some sort of placeholder for functions, but I am not sure why it appears in my output? How can I just get the diagonal matrix in term of its elements? Thank you!

I believe it is because you have more unknown variables than equations
matA = {{0, a, 0}, {a, b, c}, {0, c, 0}}; (* remove d *)
eigenvalues = Eigenvalues[matA];
DiagonalMatrix[eigenvalues];

(*{{0, 0, 0}, {0, 1/2 (b - Sqrt[4 a^2 + b^2 + 4 c^2]), 0}, {0, 0, 
  1/2 (b + Sqrt[4 a^2 + b^2 + 4 c^2])}}*)

For more details on #1 (or Slot) have a look here: explanation of #1 and #2
