Let $X$ be a complex manifold with complex dimension $d$ and structure sheaf $\mathcal{O}_X$. Let $E$ be a locally free sheaf on $X$. A $holomorphic$ connection on $E$ is a morphism of sheaves $$\nabla: E \to E \text{ }\otimes_{\mathcal{O}_X} \Omega_{X}^{1} $$ satisfying the product rule $\nabla(fs) = s \otimes df + f\nabla(s)$ for all open $U \subset X$ with $f \in \mathcal{O}_X(U), s \in E(U)$ . The connection $\nabla$ is said to be $flat$ or $integrable$ if the composite $$ E \xrightarrow{\nabla} E \text{ } \otimes_{\mathcal{O}_X} \Omega_{X}^{1} \xrightarrow{\nabla_1} E \text{ } \otimes_{\mathcal{O}_X} \Omega_{X}^{2}$$ is $0$ where $\nabla_1$ is the map to 2forms $s \otimes w \mapsto \nabla(s) \wedge w \text{ } + s \otimes dw$. What is a simple example of a triple $(X, E, \nabla)$ with $\nabla$ nonintegrable? Any such example must necessarily have $d \geq 2$. This is crossposted from SE here. From that discussion it is apparent that integrability is a strict condition, as even the existence of a holomorphic connection on a holomorphic vector bundle implies vanishing of Chern classes in the compact Kahler case, and integrability is a still stronger condition, but I have not found an explicit example.

3$\begingroup$ If you don't impose more conditions, the answer is trivial. Take $E=\mathscr{O}_X$, with the connection given by $\nabla(1)= \omega $, where $\omega $ is any nonclosed holomorphic 1form  for instance $\omega =xdy$ on $\mathbb{C}^2$. $\endgroup$– abxMay 17, 2020 at 14:01

1$\begingroup$ There are many $G$invariant examples on tangent bundles of quotients $G/\Gamma$, where $\Gamma$ is a lattice in a complex Lie group $G$. You can use the components of the MaurerCartan form to provide connection 1forms. $\endgroup$– Ben McKayMay 17, 2020 at 14:20

$\begingroup$ @abx: Is there an example for compact complex manifold? I'm thinking that when $X$ is compact Kahler, all holomorphic 1forms are closed, so there is no such trick for nonflat connection on $\mathcal{O}_X$. $\endgroup$– AG learnerMay 17, 2020 at 15:57

2$\begingroup$ Yes. Take for $X$ an abelian surface, $(\alpha ,\beta )$ a basis of holomorphic 1forms, and define $\nabla$ on $\mathscr{O}_X^2$ by $\nabla(e_1)=e_2\otimes \alpha $, $\nabla (e_2)=e_1\otimes \beta $ (here $(e_1,e_2)$ is the natural basis of $\mathscr{O}_X^2$). $\endgroup$– abxMay 17, 2020 at 17:29

$\begingroup$ My examples are compact. $\endgroup$– Ben McKayMay 17, 2020 at 18:59
1 Answer
Probably this answer intersects with the previous ones. Consider the complex Heisenberg group $H$ of the $3\times 3$ complex matrices with 1 on the diagonal and 0 under the diagonal. Let $x, y, z$ be the other entries, $z$ being in the corner. The center $Z$ is $\{x=y=0\}$. One has the (trivial) line bundle $$Z\to H\to H/Z\cong C^2$$ The leftinvariant $2$plane field $\nabla$ whose value at $I$ is $z=0$ is a nonintegrable holomorphic connection on this bundle. If one insists that the manifolds be compact, one just has to quotient $H$ on the right by the lattice $\Gamma$ of matrices with entries in $Z[i]$. Let $E:=C/Z[i]$. One has the bundle $$E\to (H/\Gamma)\to E^2$$ and the image of $\nabla$ is a nonintegrable holomorphic connection on this bundle.
Another famous explicit example is the hyperplane distribution $\nabla$ orthogonal to the complex lines in $C^{n+1}\setminus 0$, which is a holomorphic connection for the tautological line bundle over $CP^{n}$, and not integrable for $n\ge 2$.