May be $TM$ a tangent bundle of the manifold $M$ and $\wedge^n TM$ the set of all $n$-forms. The map $d: \bigwedge^n TM \rightarrow \bigwedge^{n+1}TM$ is called the exterior derivative and it holds $d^2=0$ such there can be built the DeRham complex
$$\cdots \overset{d_{n-1}}\longrightarrow \bigwedge^n TM \overset{d_n}\longrightarrow \bigwedge^{n+1}TM \overset{d_{n+1}}\longrightarrow \cdots$$
with the $n$-th cohomology class $H_n =\ker(d_n)/\operatorname{im}(d_{n-1})$. May be $A$ a 1-form field on $M$. Then the first cohomology class is given by all $A \in \wedge^1 TM$ with $dA=0$ but with the restriction $A \neq d \phi$ for a 0-form field $\phi$. How I can compute the most general expression for the first cohomology class (or higher cohomology classes)?
Attempt:
The function $A(\vec{x}) = \int_{\partial M} d^nx'|\vec{x}-\vec{x'}|^{1-n} K(\vec{x'})n(\vec{x'})$ with the 1-form unit normal vector field $n(\vec{x'})$ and an arbitrary function $K(\vec{x'})$ (or similar functions?) satisfies above conditions.