D-module that is coherent as O-module Suppose that $X$ is an algebraic variety over $\mathbb C$, not necessarily smooth. Is it still true that each $\mathcal D_X$-module ($\mathcal D_X$ is of course the sheaf of differential operators) that is coherent as an $\mathcal O_X$-vodule must be locally free as an $\mathcal O_X$-module?
Thank you in advance,
Serge
 A: [Edited to correct errors pointed out by David Ben-Zvi and to answer a query by serge_I. These corrections reduce this ``answer'' to the status of a comment.] 
(1) (Over $\mathbb C$) Under strong assumptions on the singularities of $X$ (namely, that $X$ should be cuspidal, Ben-Zvi and Nevins, arXiv 0212094v3), if $\mathcal E$ is coherent on $X$, then giving it a structure as a $\mathcal D_X$-module means giving an isomorphism $\phi:p_1^*\mathcal E\to p_2^*\mathcal E$, where $\mathcal X_1$ is the completion of $X\times X$ along the diagonal and $p_1,p_2:\mathcal X_1\to X$
are the projections. (There is also the cocycle condition,
$p_{31}^*\phi=p_{32}^*\phi\circ p_{21}^*\phi,$
where $p_{ij}:\mathcal X_2\to\mathcal X_1$ are the projections from the completion
$\mathcal X_2$ of $X\times X\times X$ along the diagonal, but we don't need this here.)
Since $X$ is noetherian, there is a unique flattening stratification $X=\coprod X_i$ associated to $\mathcal E$: each $X_i$ is locally closed in $X$ and for any $f:Y\to X$, $f^*\mathcal E$ is locally free if and only if $f$ factors through some $X_i$. The existence
of $\phi$ shows that $p_1^*\mathcal E$ and $p_2^*\mathcal E$ have the same flattening stratification, while $\{p_1^{-1}(X_i)\}_i$ is the flattening stratification for $p_1^*\mathcal E$
and $\{p_2^{-1}(X_i)\}_i$ is the flattening stratification for $p_2^*\mathcal E$.
Since $X$ is irreducible, there is a unique stratum $X_0$ of maximal dimension, so that
$p_1^{-1}(X_0)=p_2^{-1}(X_0)$. Now think in terms of a tubular neighborhood of the diagonal in
$X\times X$ to see that this forces $X_0=X$, so that $\mathcal E$ is locally free provided that $X$ is cuspidal.
(2) (In char. $p$, or over any base) If $X$ is smooth and $\mathcal D_X$ is taken to be the full ring of differential operators rather than the subring generated by those operators of order at most $1$, then the same argument applies.
A: No, you can generally only get locally freeness on an open dense set. This is Lemma VII.9.3 in Algebraic D-modules by Armand Borel et al.
EDIT: just realised that Lemma talks about where $\mathcal{D}_X$-coherent modules are $\mathcal{O}_X$-locally free, not whether $\mathcal{O}_X$-coherent ones are. A $\mathcal{D}_X$-coherent module needs a good filtration by $\mathcal{O}_X$-coherent modules to be $\mathcal{O}_X$-coherent, so you may have to check that. Section II of Borel et al. should cover this, have a look there.
