Today, to divert myself, I tried to find a new proof of Basel's identity $\boxed{\sum_{j=1}^\infty\frac{1}{j^2}=\frac{\pi^2}{6}}$. I came up with the following, which essentially interprets the identity as the *invariance of the trace* under basis change. The final part is a bit dirty, but maybe someone can spot a way to simplify it.
> **Q1.** Is it already known? If not, this post is just meant to share it :-)

> **Q2.** Do you know proofs of other identities based on a similar idea, namely viewing both sides as the trace of something?

**Proof.** Let $X:=\{f\in L^2([-1,1])\mid f(-x)=-f(x)\}$ be the space of odd functions, which has the Hilbert basis $\{e_j(x):=\sin(j\pi x)\}_{j=1}^\infty$.
Call $S:X\to X$ the operator given by $S(f):=-\iint f$, where $\int$ denotes the mean-zero primitive. We have $S(e_j)=\frac{e_j}{\pi^2 j^2}$, so $S$ is positive and symmetric with square root $T(e_j):=\frac{e_j}{\pi j}$.

Let $X_n$ be the linear span of $\{x,\dots,x^{2n-1}\}$. Since $\{x,x^3,\dots\}$ spans a dense subset of $X$ (proof: approximate any $f\in X$ with a polynomial $p$, then take $\frac{p(x)-p(-x)}{2}$), the Gram-Schmidt algorithm gives a Hilbert basis of polynomials $\{p_j\}$ (which happen to be the odd Legendre polynomials). Now

$$\begin{aligned} \lambda&:=\sum_{j=1}^\infty\frac{1}{\pi^2 j^2}
=\sum_{j=1}^\infty\langle Se_j,e_j\rangle
=\sum_{j=1}^\infty\|Te_j\|^2
=\sum_{j=1}^\infty\sum_{k=1}^\infty|\langle Te_j,p_k\rangle|^2 \\
&=\sum_{k=1}^\infty\sum_{j=1}^\infty|\langle e_j,Tp_k\rangle|^2
=\sum_{k=1}^\infty\|Tp_k\|^2
=\lim_{n\to\infty}\sum_{k=1}^n\langle Sp_k,p_k\rangle. \end{aligned} $$

Being $\{p_1,\dots,p_n\}$ an orthonormal basis of $X_n$, this expresses the fact that $\lambda$ is the limit of the trace $\lambda_n$ of $S_n:=\Pi_nS:X_n\to X_n$, where $\Pi_n:X\to X_n$ is the orthogonal projection.

Using the basis $x,x^3,\dots,x^{2n-1}$ and computing $S(x^{2j-1})=-\frac{x^{2j+1}}{2j(2j+1)}+c_jx$,
we get
$$ S(x^{2j-1})=-\frac{x^{2j+1}}{2j(2j+1)}+c_jx\text{ for }1\le j<n,\quad S(x^{2n-1})=-\frac{\Pi_n(x^{2n+1})}{2n(2n+1)}+c_nx. $$
Finally, it is easy to check that $$\Pi_n(x^{2n+1})=x^{2n+1}-\frac{(2n+1)!}{(4n+2)!}\frac{d^{2n+1}}{dx^{2n+1}}(x^2-1)^{2n+1}$$
and thus the coefficient of $x^{2n-1}$ in $\Pi_n(x^{2n+1})$ is
$(2n+1)\frac{(2n+1)!}{(4n+2)!}\frac{(4n)!}{(2n-1)!}\sim\frac{n}{2}$. Thus, by definition of trace, $\lambda_n=c_1+O(\frac{1}{n})$ and we get $\lambda=c_1=\frac{1}{6}$.