Let $X$ be a complete intersection of $m$ hypersurfaces in $P^n$ over some field $k$. I have computed that the canonical sheaf is $\omega_X=\mathcal{O}_X(\sum d_i-n-1)$, where $d_i$ are the degrees of the hypersurfaces. I also know that the canonical divisor of a hypersurface $Y$ is $K_Y=(d-n-1)H$ if $Y$ is a hypersurface of degree $d$.
How should I compute the canonical divisor of a complete intersection of hypersurfaces? It is probably something simple that I didn't observe. Thanks in advance.
Let $H$ be a hyperplane section of $Y$, such that the embedding $\iota$ of $Y$ into $\mathbb{P}^n$ is given by $|H|$. Then by definition $\mathcal{O}_X(1)=\iota^*\mathcal{O}_{\mathbb{P}^n}(1)=\mathcal{O}_X(H)$. Hence $\omega_X=\mathcal{O}_X(-n-1+\sum{d_i})=\mathcal{O}_X((-n-1+\sum{d_i})H)$. Therefore, the canonical divisor (which is only determined up to linear equivalence) is given by $K=(-n-1+\sum{d_i})H$.