# Trying to understand relationship between Dirichlet energy of graphs and discrete laplacian

I'm a noob cs masters student trying to understand how the laplacian and the Dirichlet sum are related. So there is this popular expression with graph adjacency matrix $$A$$ and the laplacian $$L$$,

$$\sum_{ij}A_{ij}(x_i -x_j)^2 = x^tLx.$$

I'm trying to find the proof for this (for specific problem of undirected graphs). I tried to expand this out as $$\sum_{ij}A_{ij}(x_i -x_j)^2 = \sum_{ij}A_{ij}x_i^2 + \sum_{ij}A_{ij}x_j^2 - 2\sum_{ij}A_{ij}x_ix_j \\ = \sum_{i}x_id_i + \sum_{j}x_jd_j - 2\sum_{ij}A_{ij}x_ix_j. \\$$ Where $$d$$ is the degree vector. Now, I know that $$L = diag(d)-A$$. My question is how do I get from the result before to $$x^tLx$$. I apologize if this is a stupid question, I tried finding proofs online but could not find a simple solution.

edit: typo in equation

• I'm glad it helped, good question too Mar 17, 2020 at 20:58
• Thanks Daniel, one question though. Shouldn't the dirac function be $\delta_{ii}$? That would mean the value is one only in the diagonals right? Mar 18, 2020 at 21:15
• yes is only one value what we desire but we have to go trough all them $(\delta_{i1},\delta_{i2},...,\delta_{ii},...,\delta_in)=(0,0,...,\delta_{ii}=1,...0)$ so effectively only survives the one that is in the diagonal that is $\delta_{ii}=1$ and $\delta_{ij\neq i}=0$, notice $\delta_{ij}$ is a function of $j$ then if you write $\delta_{ii}$ you have already evaluated you variable at the point $j=i$ so is no longer a function of $j$ that means $\sum_jd_j\delta_{ii}=\delta_{ii}\sum_jd_j=\sum_jd_j$, instead of $\sum_jd_j\delta_{ij}=d_i$ Mar 18, 2020 at 21:49

$$\sum_{ij,j