On ( V n , g), a compact Riemannian manifold of dimension n>4 and metric g, we set some existence theorems of solutions for an elliptic partial differential equation of fourth-order (E) with critical Sobolev exponent when f( x) is a positive function. Let ν be the inf of the functional associated to Eq. (E) we prove that if K 2 2[sup f( x)] 1−4/ n ν<1 Eq. (E) has a nontrivial solution ψ∈ C 5, α ( V), α∈(0,1) (or C ∞( V)). As in the constant case f( x)=Const. (studied in the previous article [Caraffa, J. Math. Pures Appl. 80 (9) (2001) 941–960]) some geometrical applications of this theorem are given. In particular when n=6, even though the calculations are different, we find that the condition of existence for a solution, remains the same for f( x)=Const. In the last part we study the same equation on ( W n , g), a compact Riemannian manifold with boundary of dimension n>4 and metric g, with boundary conditions not necessarily zero. We prove some existence theorems of solutions for this problem.