Dimension of cokernel of map between regular functions Suppose that $X\subset\mathbb{P}^{2}$ is the curve given by $x_{1}^{n} = x_{2}x_{0}^{n-1}-x_{2}^{n}$ with $n\geqslant 2$. Notice that $X = (X\cap D(x_{0}))\cup (X\cap(D(x_{2})) =: X_{1}\cup X_{2}$, where $D(x_{i})=\{(x_{0}:x_{1}:x_{2})\in\mathbb{P}^{2}\rvert x_{i}\neq 0\}$. Consider the diagram of $k$-vectorspaces
$\mathcal{O}_{X}(X)\xrightarrow{\delta_{0}} \mathcal{O}_{X}(X_{1})\times \mathcal{O}_{X}(X_{2}) \xrightarrow{\delta_{1}} \mathcal{O}_{X}(X_{1}\cap X_{2}))$, 
where $\delta_{0}:f \mapsto (f\rvert_{X_{1}},f\rvert_{X_{2}})$ and $\delta_{1}:(f_{1},f_{2})\mapsto f_{1}\rvert_{X_{1}\cap X_{2}} - f_{2}\rvert_{X_{1}\cap X_{2}}$. 
I want to show that the dimension of the cokernel of $\delta_{1}$ is $(n-1)(n-2)/2$. 
My attempt: Since $\mathcal{O}_{X}$ is a sheaf we know that $\ker(\delta_{1}) = im(\delta_{0})$, and that $\delta_{0}$ is injective. Notice that $coker(\delta_{1}) = \mathcal{O}_{X}(X_{1}\cap X_{2})/im(\delta_{1})$.
Claim 1: $\mathcal{O}_{X}(X) = k$. Let $f\in\mathcal{O}_{X}(X)$, then we can view $f$ as a morphism from $X\rightarrow \mathbb{A}^{1}$. We can extend this map to a morphism $\tilde{f}:X\rightarrow\mathbb{P}^{1}, x\mapsto (1:f(x))$. If $\tilde{f}(X)$ is closed in $\mathbb{P}^{1}$, then we know that since $\tilde{f}$ is not onto that $\tilde{f}(X) = \{P_{1},...,P_{r}\}$ is a finite set of points. Consequently we find that $X = \cup_{i=1}^{r}f^{-1}(Q_{i})$ for some $Q_{i}\in\mathbb{A}^{1}$. And since $X$ is irreducible we must have that $X = f^{-1}(Q_{i})$ for some $i$. 
First problem: How does one show in the above that $\tilde{f}(X)$ is closed in $\mathbb{P}^{1}$? 
Since $\mathcal{O}_{X}(X) = k$ and $\delta_{0}$ is injective we find that $\dim(im(\delta_{0})) = 1 = \dim(\ker(\delta_{1}))$. My idea would be to use that $\delta_{1}$ is a linear map, so $(\mathcal{O}_{X}(X_{1})\times\mathcal{O}_{X}(X_{2}))/\ker(\delta_{1})\cong im(\delta_{1})$. So if I can find a basis for $\mathcal{O}_{X}(X_{1})$, $\mathcal{O}_{X}(X_{2})$ and $\mathcal{O}_{X}(X_{1}\cap X_{2})$, then I can probably deduce the basis of $coker(\delta_{1})$. 
New attempt: Notice that under the isomorphism $\varphi_{0}: X_{1}\rightarrow Z(x_{0,1}^{n} - x_{0,2} + x_{0,2}^{n})=: Y_{1} \subset\mathbb{A}^{2}, (x_{0}:x_{1}:x_{2})\mapsto (\frac{x_{1}}{x_{0}},\frac{x_{2}}{x_{0}})$ we have $\mathcal{O}_{X}(X_{1}) \cong\mathcal{O}_{Y_{1}}(Y_{1}) = k[x_{0,1},x_{0,2}]/(x_{0,1}^{n}-x_{0,2}+x_{0,2}^{n})$, consequently we easily see that a basis is given by $\{x_{0,1}^{i}\}_{i=1}^{n} \cup \{x_{0,2}^{j}\}_{j\geqslant 0}$, since $x_{0,1}^{n} = x_{0,2}-x_{0,2}^{n}$. 
One can do the same for $X_{2}$, where we use $\varphi_{2}:X_{2}\rightarrow Z(x_{2,1}^{n}-x_{2,0}^{n-1} + 1):=Y_{2}$, and then we can find the basis $\{x_{2,1}^{l}\}_{l=1}^{n} \cup \{x_{2,0}^{m}\}_{m\geqslant 0}$. 
From here I am stuck, for instance I don't know how to find a basis for $\mathcal{O}_{X}(X_{1}\cap X_{2})$. 
 A: It is straightforwards to check that $D(x_0)\cap D(x_2)=D(x_0x_2)$, so the coordinate algebra of this open set is of the form $k[\frac{x_1}{x_0},\frac{x_2}{x_0},\frac{x_0}{x_2}]$. So the sheaf condition gives that $$ 0\to \mathcal{O}_X(X) \to \frac{k\left[\frac{x_1}{x_0},\frac{x_2}{x_0}\right]}{\left(\frac{x_1^n}{x_0^n}=\frac{x_2}{x_0}+\frac{x_2^n}{x_0^n}\right)}\bigoplus \frac{k\left[\frac{x_0}{x_2},\frac{x_1}{x_2}\right]}{\left(\frac{x_1^n}{x_2^n}=\frac{x_0^{n-1}}{x_2}+1\right)}\to \frac{k\left[\frac{x_1}{x_0},\frac{x_2}{x_0},\frac{x_0}{x_2}\right]}{\left(\frac{x_1^n}{x_0^n}=\frac{x_2}{x_0}+\frac{x_2^n}{x_0^n}\right)}$$ is an exact sequence of $k$-vector spaces. This means that we don't need to use your claim 1 to prove that $\mathcal{O}_X(X)=k$: we can get it from analyzing the exact sequence above.
In order to compute the only nontrivial kernel in the sequence, let $f_i\in \mathcal{O}_X(X\cap D(x_i))$ be polynomials of degree $d_i$. After clearing denominators of $f_0=f_2$, we see that the polynomials must have the same degree. By comparing coefficients of the powers of $x_1$ present, we see that $x_1$ can't be present on either side. Then the calculation of the kernel reduces to the same calculation that the only global functions on $\Bbb P^1$ are the constants, so we get that $\mathcal{O}_X(X)=k$.
We see that a basis of each of the summands of the middle term can be given by $\{\frac{x_1^dx_2^m}{x_0^{d+m}}\}_{0\leq d<n,0\leq m}$ and $\{\frac{x_1^dx_0^m}{x_2^{d+m}}\}_{0\leq d<n,0\leq m}$ respectively. To find a basis of the final term of our sequence, we note that $x_1^nx_0^{-m}x_1^{m-n}=\cdots$ for $m\in\Bbb Z$ are in the ideal we mod out by via multiplying the generator of the ideal by powers of the unit $\frac{x_0}{x_2}$. If we apply these rules to rewrite terms, we can see that $\{x_1^dx_0^{-m}x_2^{m-d}\}_{0\leq d<n,m\in\Bbb Z}$ forms a basis for the final term.
To compute the cokernel, I claim that the only terms not in the image of the map from the middle term are those of the form $x_1^dx_0^{-m}x_2^{-d+m}$ for $0<d<n$ and $1<m<d$, which gives the required dimension count. To prove this, we note that it's immediate that all the terms not involving $x_1$ are in the image: write them as a difference of terms involving only powers of $\frac{x_0}{x_2}$ and $\frac{x_2}{x_0}$, which we then see are in the image. Next, if $m\leq 0$ we get that such a term is already in the basis $\{\frac{x_1^dx_0^m}{x_2^{d+m}}\}_{0\leq d<n,0\leq m}$ of the second summand, similarly for terms with $m\geq d$ and the basis of the first summand. To prove this, suppose such a term can be written as $f-g$ for $f\in\mathcal{O}_X(X\cap D(x_0)$ and $g\in\mathcal{O}_X(X\cap D(x_2))$. It's clear that we may assume $f=\sum_{i=1}^{d-1} a_i\frac{x_1^i}{x_0^i}$ and $g=\sum_{i=1}^{d-1} b_i\frac{x_1^i}{x_2^i}$. Clearing denominators and comparing coefficients we see that this cannot be the case. 
