Talk:Eigenvalues and eigenvectors

$$??\mid\; U(x,y) \;=\; \underbrace{\left. \frac 1 2 \frac{\partial^2 U}{\partial x^2} \right |_0 \cdot x^2 \;+\;  \left. \frac{\partial^2 U}{\partial x\partial y }\right |_0 \cdot xy \;+\; \left. \frac 1 2 \frac{\partial^2 U}{\partial y^2}\right |_0 \cdot y^2 } _\text{second order}$$

$$\left. \frac 1 2 \frac{\partial^2 U}{\partial x^2} \right |_0 \cdot x^2 \left. \frac{\partial^2 U}{\partial x\partial y }\right |_0 \cdot xy \;+\; \left. \frac 1 2 \frac{\partial^2 U}{\partial y^2}\right |_0 \cdot y^2 $$

Python code
I had a bunch of linear algebra and machine learning demos I wrote at one point. I couldn't find them but I wrote up something similar just for kicks and thought I'd share it. It plots the columns of T's matrix as well, so you can see how it transforms the vector space along with the eigenvectors. I see you have a bunch of good examples already, but it's a neat tool to play around with. AP295 (discuss • contribs) 05:47, 24 January 2024 (UTC)

actual code
I once actively programmed python an have a version on my computer. Your code performed nicely. Thanks 23:19, 24 January 2024 (UTC)

Deriving the formula for eigenvalue k
The formula for k in terms of $$\alpha, \beta, \gamma$$ is obtained from Bard. Here is a double check:

$$H\mid\quad\begin{bmatrix}\alpha -k & \gamma\\\gamma & \beta-k\end{bmatrix}\begin{bmatrix} x \\y \end{bmatrix}=\begin{bmatrix}0 \\0\end{bmatrix}$$

$$1\mid\quad (k-\alpha)(k-\beta)+\gamma^2=0$$ This is the determinant

$$2\mid\quad k^2-(\alpha+\beta)k+\alpha\beta-\gamma^2=0=ak^2+bk+c=0$$ Standard form for quadratic equation

$$3\mid\quad a=1\,,\quad b=-(\alpha+\beta)\,,\quad c=\alpha\beta - \gamma^2$$ Substitute from (3) and push $$4\alpha\beta$$ inside the previous polynomial (which is a perfect square.)

$$4\mid\quad b^2-4c= (\alpha^2 + 2\alpha\beta +\beta^2)-4\alpha\beta+4\gamma^2 =(\alpha-\beta)^2 +4\gamma^2$$ As a double check, rewrite this in a more convenient form:

$$5\mid\quad \left(\frac b 4\right)^2 - c = \frac{b^2-4c}{4} = \left(\frac{\alpha-\beta}{2}\right)^2+\gamma^2$$ Well known solution to quadratic equation with a=1.

$$6\mid\quad k=\frac{ -b \pm \sqrt{b^2-4c}    }{2}$$ Substitute (3) and (4) into (6):

$$7\mid\quad k=\frac{ (\alpha+\beta) \pm \sqrt{(\alpha-\beta)^2 +4\gamma^2}    }{2}$$ Rewrite (6):

$$8\mid\quad k=-\frac b 2 \pm \sqrt{\left(\frac b 4\right)^2 - c}$$ Substitute (3) and (5) into (8)

$$9\mid\quad =\frac{\alpha + \beta}{2} \pm \sqrt{ \left( \frac{\alpha-\beta}{2}\right)^2+\gamma^2 }$$ I find (9) more convenient than (8)

Guy vandegrift (discuss • contribs) 03:30, 28 January 2024 (UTC)