Diagonalizing quadratic forms in WolframAlpha

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 7K views
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[].