MHB Diagonalizing quadratic forms in WolframAlpha

AI Thread Summary
The discussion centers on diagonalizing quadratic forms using WolframAlpha and the challenges encountered in matrix manipulation. A user seeks to find a change-of-basis matrix and an orthogonal matrix that diagonalizes a symmetric matrix associated with a quadratic form. They provide an example matrix and express difficulty in verifying a matrix equation in WolframAlpha due to its misinterpretation of the Transpose function. It is noted that WolframAlpha can perform singular value decomposition, which may help in deducing the necessary matrices. The issue with matrix multiplication can be resolved by using the multiplication symbol instead of the dot operator.
Evgeny.Makarov
Gold Member
MHB
Messages
2,434
Reaction score
4
Hello,

Suppose I have a vector space $V$ over $\Bbb R$, a quadratic form $f(x)$ over $V$, some basis of $V$ and a symmetric matrix $A$ corresponding to $f$ in that basis, i.e., $f(x)=x^TAx$. Using, for example, the Lagrange method, I can find a change-of-basis matrix $C$ ($x=Cx'$) such that in the new basis the matrix $C^TAC$ of $f$ is diagonal with $1$, $-1$ and $0$ on the diagonal. I can also find an orthogonal matrix $C$ such that $C^TAC$ is diagonal (with arbitrary values on the diagonal). Is it possible to find each of these two decompositions in WolframAlpha? Maybe there is some other online service where this can be done?

A related question. Suppose
\[
A=\begin{pmatrix}
0&1/2&1/2\\
1/2&0&1/2\\
1/2&1/2&0
\end{pmatrix}
\]
and using the Lagrange method I found
\[
D=C^{-1}=\begin{pmatrix}
1/2&1/2&1\\
1/2&-1/2&0\\
0&0&1
\end{pmatrix}
\]
I want to check in WA that
\[
D^T\begin{pmatrix}1&0&0\\0&-1&0\\0&0&-1\end{pmatrix}D=A.
\]
I type the following in WA
Code:
Transpose[{{1/2,1/2,1},{1/2,-1/2,0},{0,0,1}}].{{1,0,0},{0,-1,0},{0,0,-1}}.{{1/2,1/2,1},{1/2,-1/2,0},{0,0,1}}
but it is interpreted as though the function Transpose[] is applied to the product of the three matrices: see here! What's up with that?
 
Physics news on Phys.org
I'm not aware of an online tool to do the diagonalizations you ask for.
I do know that W|A will do a singular value decomposition (SVD) for you automatically on any matrix. I think you should be able to deduce your matrices from that.

As for your problem with W|A, I've noticed that it shows indeed some odd behavior when manipulating and multiplying matrices.
However, your immediate problem can be fixed by using * instead of $\cdot$.
 
Click

Yes, it seems WA does not recognize the Mathematica function Transpose[].
 
Back
Top