I will try to stay at the most elementary level possible.
Let $\mathcal L \in \mathrm{Pic}(X)$. Then $\mathcal L|_{U_1} \simeq \mathcal O_X|_{U_1}$ and $\mathcal L|_{U_2} \simeq \mathcal O_X|_{U_2}$ since $\mathrm{Pic}(\mathbb A^1_k)$ is trivial. Since
$$
\Gamma(X,\mathcal O_X) \simeq \{ (f_1,f_2) \in k[x_1] \times k[x_2] \, | \, f_1(x) = f_2(x) \quad \forall x \in k \backslash \{0\} \} \simeq k[x],
$$
we can inspire ourself from this definition and define invertible sheaves $\mathcal L_n$ for $n \in \mathbb Z$ and $U \subseteq X$ by "twisting" this glueing as follows : if $n \in \mathbb Z$,
$$
\mathcal L_n(U) \overset{def}= \{ (s,t) \in \mathcal O_{U_1}(U \cap U_1) \times \mathcal O_{U_2}(U \cap U_2) \, | \, x^n (s|_{U \cap U_1 \cap U_2}) = t|_{U \cap U_1 \cap U_2} \}.
$$
Note that $\mathcal L_n \otimes_{\mathcal O_X} \mathcal L_m \simeq \mathcal L_{m+n}$, so in particular $\mathcal L_n$ is invertible with inverse $\mathcal L_{-n}$.
Example. For $n \ge 0$ and $U \subseteq U_1$, we have
$$
\mathcal L_n(U) = \{ (s,x^ns|_{U \cap U_2}) \in \mathcal O_X(U) \times \mathcal O_X(U \cap U_2) \} \simeq \mathcal O_X(U)
$$
and these isomorphisms commute with restriction so we have $\mathcal L_n|_{U_1} \simeq \mathcal O_X|_{U_1}$. Similarly, for $U \subseteq U_2$ we have
$$
\mathcal L_n(U) = \{ (s|_{U \cap U_1},x^n s) \in \mathcal O_X(U \cap U_1) \times \mathcal O_X(U) \} \simeq \mathcal O_X(U)
$$
and this time the isomorphism of $\mathcal O_X(U)$-modules projects on the second component instead of the first, which explains why $\mathcal L_n$ does not glue to $\mathcal O_X$ ; these sheaf isomorphisms do not agree on overlaps, differing by a factor of $x^n$. Since $U \cap U_1$ does not contain the origin of $U_1$, this allows the first component $s|_{U \cap U_1}$ to have a pole of order up to $n$ at zero when $U \subseteq U_2$.
Now this proves that we have a group homomorphism $\mathbb Z \to \mathrm{Pic}(X)$ (in a very explicit manner, which I like) but it does not prove that this is the whole of the Picard group, i.e. that our map is an isomorphism. For this we use Cartier divisors, which is a bit less pedagogical for the Picard group but more efficient.
Note that since $X$ is integral, the sheaf $\mathcal K^{\times}$ is constant and equal to $k(x)$. A Cartier divisor on $X$ can be described by the following data : a collection $\{(V_i,f_i)\}$ where the $V_i$ cover $X$ and the $f_i$ are such that on $V_i \cap V_j$, the section $f_i/f_j$ lies in $\Gamma(V_i \cap V_j, \mathcal O_X^{\times})$. We can restrict Cartier divisors to $U_1$ and $U_2$, and since they each have trivial Picard group, their Cartier divisors are all principal, that is, Cartier divisors on $X$ are given by pairs $(f_1,f_2)$ such that $f_i \in \Gamma(U_i,\mathcal K^{\times})$ and $f_1/f_2 \in \Gamma(U_1 \cap U_2, \mathcal O^{\times})$. Finally, the Cartier class group is the group of Cartier divisors modulo principal Cartier divisors.
General Cartier divisors go as follows : we are given a pair $(f_1,f_2) \in (k(x)^{\times})^2$ such that
$$
f_1/f_2 \in k[x]_x^{\times} = \{ ax^n \, | \, a \in k, \quad n \in \mathbb Z \}.
$$
A Cartier divisor given by the pair $(f_1,f_2)$ is principal if and only if $f_2 = a f_1$ for some $a \in k^{\times}$. To see this, it is clear that the Cartier divisor $(f,f)$ is principal ; so it remains to see that the Cartier divisor $(1,a)$ is principal for $a \in k^{\times}$. But this is clear since it generates the subsheaf $\mathcal O_X$ of $\mathcal K$ (see Hartshorne, Chapter II, Proposition 6.13 (c)).
This is something that confused me for a long time ; although a Cartier divisor can be described by a collection $\{(U_i,f_i)\}$, it is not characterized by it, even if we fix the cover we are defining it on ; changing one $f_i$ by an element of $\mathcal O_X(U_i)^{\times}$ does not change the Cartier divisor since the stalk of the corresponding global section of $\mathcal K^{\times}/\mathcal O^{\times}$ remains unchanged. So the Cartier divisor given by $(1,1)$ is in fact the same Cartier divisor given by $(1,a)$.
So letting $H \subseteq (k(x)^{\times})^2$ be the subgroup of all $(f_1,f_2)$ satisfying the above Cartier condition, and modding out $H$ by the subgroup of all principal divisors, we can write any element of the quotient in the form $(1,x^n)$ for some $n \in \mathbb Z$.
We deduce
$$
\mathrm{Pic}(X) \simeq \mathbb Z.
$$
Also note that the group isomorphism $\mathcal{CaCl}(X) \to \mathrm{Pic}(X)$ sends the Cartier divisor corresponding to $(1,x^n)$ to the invertible sheaf $\mathcal L_{-n}$ since $\mathcal L_{-n}$ is generated by $1$ on $U_1$ and by $x^{-n}$ on $U_2$ (when we see $\mathcal L_{-n}$ as an invertible subsheaf of $\mathcal K$ using the embedding $\mathcal L_{-n} \to \mathcal L_{-n} \otimes_{\mathcal O_X} \mathcal K \simeq \mathcal K$).
Hope that helps,