= Solution
For an <affine variety>, every <coherent ideal sheaf> is <quasi-coherent>; <vanishing of quasi-coherent cohomology on an affine scheme> therefore gives $H^1(X,\mathcal I)=0$.
For the projective-space complement, assume $n\geq1$ and choose two distinct <closed points> $P,Q\in X$. Take the <ideal sheaf of two closed points> $\mathcal I=\mathfrak m_P\cap\mathfrak m_Q$ on $X$. The <codimension-two extension of regular functions on a normal variety> gives
$$
\Gamma(X,\mathcal O_X)=\Gamma(\mathbb P^n,\mathcal O_{\mathbb P^n})=k.
$$
One can see this directly: on every standard <affine chart> of $\mathbb P^n$, a <rational function> written in lowest terms cannot have a nonconstant denominator, because an <irreducible polynomial> factor of the denominator would define a pole along a codimension-one <hypersurface>, and such a hypersurface is not removed by $Z$. The extended function is constant because every global <regular function> on <projective space> is constant. Now the <short exact sequence>
$$
0\to\mathcal I\to\mathcal O_X\to k_P\oplus k_Q\to0
$$
sends $k$ diagonally into $k^2$ on <global sections>. Its <cokernel> is $k$, and the <long exact sequence in sheaf cohomology> injects that <cokernel> into $H^1(X,\mathcal I)$. Thus
$$
\boxed{H^1(X,\mathcal I)\ne0.}
$$
The assumption $n\geq1$ is necessary: $\mathbb P^0$ is already affine and has no such example.
Back to article page