Let $X$ be a smooth projective surface in $\mathbb{P}^n$ and $C$ be an effective curve. I know that the dualizing sheaf, $\omega\_C$ of $C$ is $\mathcal{E}xt^{n-1}\_{\mathbb{P}^n}(\mathcal{O}\_C,K\_{\mathbb{P}^n})$ where $K\_{\mathbb{P}^n}$ is the canonical sheaf on $\mathbb{P}^n$. As far as I have read (from some articles) that $\omega\_C \cong \mathcal{E}xt^1\_{X}(\mathcal{O}\_C,K\_X)$. But I do not understand why this is true. Could somebody help?



On the dualizing sheaf of a curve
This of course can be found in any reference on duality (e.g. Hartshorne "Algebraic Geometry" chap. 3) but in Hartshorne's proof it's somehow mysterious where the $\mathscr{E}xt^{n-1}\_P(\mathscr{O}, \omega\_{P^n})$ comes from. You can explain it by studying relative duality for morphisms (e.g. Hartshorne "Residues and Duality"), in particular for the closed immersion $i:C\to \mathbb{P}^n$. Here is another argument (in a way it's the proof from Hartshorne's AG done backwards, so that we can see how this $\mathscr{E}xt^{n-1}$ appears).


Recall that a dualizing sheaf is a sheaf $\omega$ which satisfies $H^1(C, F)^\vee = Hom\_C(F, \omega)$ for every coherent $F$ on $C$.


A thing to start with is duality on $P:=\mathbb{P}^n$:
$$ H^1(C, F)^\vee = H^1(P, F)^\vee = Ext^{n-1}\_P(F, \omega\_P). $$


We now need a natural isomorphism between $Ext^i\_P(F, \omega\_P)$ and $Hom\_C(F, \omega)$ for some $\omega$. A good thing to do to compare $Hom$'s and $Ext$'s on $P$ and $C$ is to find a spectral sequence comparing the two. Let us look at the functors
$$ Coh(P) \to Coh(C) \to Ab $$
where the first functor is $\mathscr{H}om\_P(\mathscr{O}\_C, -)$ and the second is $Hom\_C(F, -)$, their composition $Hom\_P(F, -)$. The spectral sequence of this composition is
$$ E^{ij}\_2 = Ext^i\_C(F, \mathscr{E}xt^j\_P(\mathscr{O}\_C, G)) \Rightarrow Ext^{i+j}\_P(F, G). $$
For $i+j=n-1$ and $G=\omega\_P$ we have our group $Ext^{n-1}\_P(F, \omega)$ on the right hand side, and we have $E^{0,n-1}\_2 = Hom\_C(F, \mathscr{E}xt^{n-1}\_P(\mathscr{O}\_C, \omega\_P)$, which suggests we should take $\omega = \mathscr{E}xt^{n-1}\_P(\mathscr{O}\_C, \omega\_P)$. 


In fact, because $C$ is a smooth curve, the above spectral sequence just boils down a to ``universal coefficients'' short exact sequence 
$$ 0 \to Ext^1\_C(F, \mathscr{E}xt^{n-2}\_P(\mathscr{O}\_C, \omega\_P)) \to 
Ext^{n-1}\_P(F, \omega\_P)
\to Hom\_C(F, \mathscr{E}xt^{n-1}\_P(\mathscr{O}\_C, \omega\_P))\to 0. $$


To prove that the second map is an isomorphism (for any $F$), we need to show that $\mathscr{E}xt^{n-2}\_P(\mathscr{O}\_C, \omega\_P)= 0 $, which is done in Hartshorne "Algebraic Geometry", chap. 3. 


