Does integration over algebraic varieties make sense? Suppose $X$ is a smooth projective variety over $\mathbf{C}$ of complex dimension $n$. Let $[\omega] \in H^{2n}_{\text{dR}}(X)$ be a de Rham cohomology class on $X$. If $\omega$ is a representative of this cohomology class, then does the integral
$$\int_X \omega $$
always converge / make sense? If not, can we always choose $\omega$ in this cohomology class so that this integral does converge?
I know that the integral $\int_X \omega$ does not converge in general. For example, if $X$ is the Riemann sphere and $\omega = dz \wedge d\overline{z}$, then $\int_X \omega = \int_{\mathbf{C}} dz \wedge d\overline{z} = \infty$.
The reason this confuses me is that de Rham's theorem says that there is a perfect pairing $H^k_{\text{dR}}(X) \times H_k(X, \mathbf{R}) \to \mathbf{R}$ given by integrating a differential form $\omega$ over a homology class $c$. But if the integrals $\int_c \omega$ don't even converge for algebraic varieties, how do we make sense of de Rham's theorem?
 A: Let $X$ denote a manifold of dimension $n$ and let $\Omega^n_c(X)$ denote the vector space of compactly supported $n$-forms on $X$. There is an integration map
$$
\int_X: \Omega_n^c(X) \to \Bbb{R}
$$
(or $\Bbb{C}$ depending on the coefficients of the forms). For this, consult any standard reference on manifold theory; e.g. Tu, Lee, or Bott and Tu. If your manifold is compact, then all forms are compactly supported and there is a map
$$
\int_X:\Omega^n(X) \to \Bbb{R}
$$
by integration. If $X$ is a smooth projective variety over $\Bbb{C}$, then in particular it is a compact complex manifold. If $[\omega] \in H_{\mathrm{dR}}^{2n}(X)$ is a top dimensional cohomology class, then the integration map is well-defined and independent of cohomology class by Stokes' theorem.
As for your example with $\omega = dz\wedge d\overline{z}$, you need to be careful as here the form $\omega$ is not a global form on $\Bbb{P}^1$, i.e. it does not extend regularly to $\infty$. Indeed, the form $dz$ has an order $2$ pole at infinity. However, if you take (e.g.) the differential $2$-form associated to the "canonical" metric on $\mathcal{O}_{\Bbb{P}^1}(-1)$ on $\Bbb{P}^1$ (for example) then it has a coordinate expression of the form
$$
\frac{1}{2\pi i}\cdot \frac{1}{(1+\lvert z\rvert^2)^2} dz\wedge d\overline{z}
$$
in the affine coordinate $z$ on $\Bbb{P}^1\setminus \{\infty\}$. It is an easy exercise in multivariable calculus to see that the integral of this form returns $-1$. The idea here is that the coefficient function of $dz\wedge d\overline{z}$ is a smooth function that dampens the growth rate of the diverging forms $dz$ and $d\overline{z}$.
