Explicit Hodge decomposition on $T^2$

Let $\sigma_1 = S^1\times \{0\}$ and $\sigma_2 = \{0\}\times S^1$ be the canonical basis for $H_1(T^2)$. As you did, I will use $dx_i$ for the basis $1$-forms on $T^2$ (since these forms on $\Bbb R^2$ are $\Bbb Z^2$-invariant and thus descend to closed forms on $T^2$). We have $\int_{\sigma_i}dx_j = \delta_{ij}$. Any harmonic $1$-form is of the form $c_1\,dx_1+c_2\,dx_2$ for some constants $c_1,c_2$.

Suppose we write the decomposition as $$\alpha = d\psi + \delta(\star\rho) + (c_1\,dx_1+c_2\,dx_2) \quad\text{for smooth functions } \psi \text{ and } \rho \text{ and appropriate constants } c_i.$$ Taking $d$ of this equation, we see that $$d\alpha = d\delta(\star\rho) = d(-\!\star\!d\!\star\!(\star\rho)) = -d\!\star\!d\rho,$$ and so $\rho$ is obtained by solving $\Delta\rho = \star d\alpha$. (Here I'm taking $\Delta = -\!\star\!\,d\star{}d$.) By our construction, the $1$-form $\tilde\alpha = \alpha - \delta(\star\rho)$ is now closed, and there is a unique harmonic form in the cohomology class of $\tilde\alpha$. In particular, take $c_1 = \int_{\sigma_1}\tilde\alpha$ and $c_2 = \int_{\sigma_2}\tilde\alpha$.

Why, then, is $\beta=\tilde\alpha - (c_1\,dx_1+c_2\,dx_2)$ exact? This is standard multivariable calculus. Since $\int_{\sigma_i}\beta = 0$ for $i=1,2$, we can define $\psi$ by integrating. That is, set $$\psi(x,y) = \int_{(0,0)}^{(x,y)}\beta,$$ and this is a well-defined smooth function on the torus with $d\psi = \beta$.

Perhaps a concrete example would be nice. Let's take $\alpha = \cos^2(\pi x_1)dx_1 + \sin(\pi x_1)dx_2$. This form is neither closed nor co-closed. If you follow my algorithm, we want $\rho$ with $\Delta\rho = \star d\alpha = \pi\cos(\pi x_1)$. For example, we can take $\rho(x_1,x_2) = \frac1{\pi}\cos(\pi x_1)$. We then have $\tilde\alpha = \cos^2(\pi x_1)dx_1 + \sin(\pi x_1)dx_2 + \star(d\rho) = \cos^2(\pi x_1)dx_1$. Then $c_1 = 1/2$ and $c_2=0$ determine the harmonic piece, and $\tilde\alpha - \frac12 dx_1 = d\big(\frac1{4\pi}\sin(2\pi x)\big)$, as desired.


$\def\RR{\mathbb{R}}\def\ZZ{\mathbb{Z}}$This basically comes down to inverting the Laplacian, which is done by the Green's function. Inverting the Laplacian came up in Ted Shifrin's solution, but I want to write an answer that emphasizes it.

We have $$(d d^{\ast} + d^{\ast} d) (a_1 (x_1, x_2) dx_1 + a_2(x_1,x_2) dx_2) = \nabla^2(a_1) dx_1 + \nabla^2(a_2) dx_2.$$ Here $$\nabla^2 = \left( \frac{\partial}{\partial x_1} \right)^2 + \left( \frac{\partial}{\partial x_2} \right)^2.$$

Given a function $h(x_1, x_2)$ on $T^2$, can we find $c(x_1, x_2)$ on $T^2$ with $\nabla^2(c) = h$? Not necessarily, because $\int_{T^2} \nabla^2(c)$ will always be zero. But it turns out that this is the only obstacle, and that we can write down solutions in terms of the Green's function of the torus. This is a function $G(x_1, x_2, y_1, y_2)$ on $(T^2 \times T^2) \setminus (\mathrm{diagonal})$ with the property that $$\nabla^2 \int_{(x_1, x_2) \in T^2} G(x_1, x_2, y_1, y_2) h(x_1, x_2) = h(y_1, y_2) - \frac{1}{\mathrm{Vol}(T^2)} \int_{(x_1, x_2) \in T^2} h(x_1, x_2) .$$ I'm probably going to drop some scalar factors here, but the Green's function of a torus is given explicitly by something like $$G(x_1, x_2, y_1, y_2) = \sum_{(n_1, n_2) \in \mathbb{Z}^2 \setminus \{ (0,0) \}} \frac{\cos {\big (}n_1 (x_1-y_1)+n_2(x_2-y_2){\big )}}{n_1^2+n_2^2}.$$ It can also be expressed in terms of Jacobi theta functions.

So, given any $1$-form $f_1 dx_1 + f_2 dx_2$, use the Green's function to find $a_j$ with $$\nabla^2 (a_j) = f_j - \frac{1}{\mathrm{Vol}(T^2)} \int_{T^2} f_j.$$

Then $$f_j dx_j = \left( \frac{1}{\mathrm{Vol}(T^2)} \int_{T^2} f_j \right) dx_j + d d^{\ast} \left(a_j dx_j \right) + d^{\ast} d \left( a_j dx_j \right).$$ So we have "explicitly" written $f_j dx_j$ as the sum of a Harmonic form, an exact form and a co-exact form. Adding this up for $f_1$ and $f_2$, we have solved the problem.