Let $D$ be the Weil divisor $D = -2[(x)] + [(x-1)] + [(x-2)]$ on $\Bbb{A}^1_k = \operatorname{Spec} k[x]$. I want to show that $\mathcal{O}_X(D) \cong \mathcal{O}_X$. To do this, it is enough to specify isomorphisms $$\mathcal{O}_X(D)(D(f_i)) \to k[x]_{f_i}$$ that agree on $D(f_i) \cap D(f_j) = D(f_if_j)$. Now to do this I calculate the following: \begin{eqnarray*} \mathcal{O}_X(D)(D(x^2)) &=& k[x]\cdot \frac{1}{(x-1)(x-2)} \\ \mathcal{O}_X(D)(D(x-2)) &=& k[x] \cdot \frac{x^2}{(x-1)} \\ \mathcal{O}_X(D)(D(x-1)) &=& k[x]\cdot \frac{x^2}{(x-2)} \\ \mathcal{O}_X(D)(D(f(x))) &=& k[x]\cdot \frac{x^2}{(x-1)(x-2)f(x)}\end{eqnarray*}
where $f$ is not one of the earlier three polynomials. Now I want to say that the map out of $\mathcal{O}_X(D)D(x^2)$ is multiplication by $(x-1)(x-2)/x^2$ and the map out of $\mathcal{O}_X(D)D(x-2)$ is mutiplication by $(x-1)/(x^2(x-2))$. However on the intersection which is $D((x-2)x^2)$, the maps don't seem to agree. What's the problem here?