I want to prove the following result
Let $X\subset\mathbb{P}^n$ be a smooth projective variety defined over $k.$ Let $Y= V(f)$ be a smooth subvariety of $X$ defined by a homogeneous polynomial $f$ of degree $d.$ Show that
$$ \omega_Y=i^*(\omega_X\otimes\mathscr{O}_X(d)), $$
where $i:Y\to X$ is the inclusion, $i^*$ is the pull-back of $i$, $\omega_Y$ is the canonical sheaf of Y, $\mathscr{O}_X(d)=i^{'*}\mathscr{O}_{\mathbb{P}^n}(d)$, $i': X \to \mathbb{P}^n$ is the inclusion.
I think of using the following exact sequences
$$ 0\to\mathscr{O}_X(-d)\to i'^*\Omega_{\mathbb{P}^n}\to\Omega_X\to0 $$ or $$ 0\to\mathscr{I}/\mathscr{I}^2\to\Omega_X\otimes\mathscr{O}_Y\to\Omega_Y\to0 $$
And I think of adjunction formula $\omega_Y\cong\omega_X\otimes\wedge^r (\mathscr{I}/\mathscr{I}^2)^*$(by Hartshorne II 8.20), where $(\mathscr{I}/\mathscr{I}^2)^* = Hom_{\mathscr{O}_Y}(\mathscr{I}/\mathscr{I}^2,\mathscr{O}_Y)$.
I want to imitate the proof of this result, but I don't understand this proof.
Perhaps this direction is wrong. Anyway, please give me some hints. Thank you!
As you point out, the adjunction formula says $$\omega_X\simeq i^*\omega_{\mathbb P^n}\otimes(\mathcal I/\mathcal I^2)^\vee,$$ so it suffices to check the isomorphism of $\mathcal O_X$-modules $$\mathcal I/\mathcal I^2\simeq \mathcal O_X(-d).$$ Recall that $\mathcal O_X$-modules are (essentially) equivalent to graded modules over the graded ring $S=k[x_0,\dots,x_n]/(f)$, with grading: $$S_{(e)}=k[x_1,\dots,x_n]_{(e)}/fk[x_1,\dots,x_n]_{(e-d)}.$$ Now, $\mathcal I/\mathcal I^2$ corresponds to the graded module $$I/I^2=\bigoplus_{e\ge0}fk[x_1,\dots,x_n]_{(e-d)}/f^2k[x_1,\dots,x_n]_{(e-2d)}.$$ On the other hand, $\mathcal O_X(-d)$ is just the Serre twist, corresponding to the graded module $$S(-d)=\bigoplus_{e\ge0}S_{(e-d)}=\bigoplus_{e\ge0}k[x_1,\dots,x_n]_{(e-d)}/fk[x_1,\dots,x_n]_{(e-2d)}.$$ There is now an obvious isomorphism of graded $S$-modules $$\begin{align*} m_f\colon S(-d)&\xrightarrow\sim I/I^2\\ x\in k[x_1,\dots,x_n]_{(e-d)}/fk[x_1,\dots,x_n]_{(e-2d)}&\mapsto fx\in fk[x_1,\dots,x_n]_{(e-d)}/f^2k[x_1,\dots,x_n]_{(e-2d)}. \end{align*}$$ given by multiplication by $f$.