  It is well known that the validity of the so called Lenard-Magri scheme of
integrability of a bi-Hamiltonian PDE can be established if one has some
precise information on the corresponding 1st variational Poisson cohomology for
one of the two Hamiltonian operators. In the first part of the paper we explain
how to introduce various cohomology complexes, including Lie superalgebra and
Poisson cohomology complexes, and basic and reduced Lie conformal algebra and
Poisson vertex algebra cohomology complexes, by making use of the corresponding
universal Lie superalebra or Lie conformal superalgebra. The most relevant are
certain subcomplexes of the basic and reduced Poisson vertex algebra cohomology
complexes, which we identify (non-canonically) with the generalized de Rham
complex and the generalized variational complex. In the second part of the
paper we compute the cohomology of the generalized de Rham complex, and, via a
detailed study of the long exact sequence, we compute the cohomology of the
generalized variational complex for any quasiconstant coefficient Hamiltonian
operator with invertible leading coefficient. For the latter we use some
differential linear algebra developed in the Appendix.
