Let $(X,\mathscr O_X)$ be a smooth surface over a field $k$ (two dimensional scheme, regular, noetherian....) and fix a point $x\in X$. Then if we complete the local ring $\mathscr O_{X,x}$ at its maximal ideal we get the isomorphism: $$\widehat{\mathscr O_{X,x}}\cong k(x)[[t,u]]$$ So my question is the following:
We have the inclusion $\mathscr O_{X,x}\subset \widehat{\mathscr O_{X,x}}$; how can we express elements $\mathscr O_{X,x}$ as power series? Are they just those elements in $k(x)[[t,u]]$ with finite power series expansion? What is the relationship between $\mathscr O_{X,x}$ and $k(x)[t,u]$?
Let $\mathfrak{m}$ denote the maximal ideal of $\mathscr{O}_{X,x}$, and let $k = k(x) = \mathscr{O}_{X,x}/\mathfrak{m}$.
Proof: By Nakayama's Lemma, $\{a_1,a_2\}$ generates $\mathfrak{m}$ as a $\mathscr{O}_{X,x}$-module, and hence their images indeed generate the associated graded ring. Hence $k[a_1,a_2]$ surjects onto the associated graded. If the kernel of this surjection $I$ is nontrivial, then $\dim k[a_1,a_2]/I < \dim k[a_1,a_2] = 2$, but the dimension of the associated graded is $2$, so the map is an isomorphism.
Now we define the isomorphism. Since the completion is an inverse limit,it suffices to define compatible maps into $\mathscr{O}_{X,x}/\mathfrak{m}^n$ for all $n$. Consider $f_n: k[[t,u]] \to \mathscr{O}_{X,x}/\mathfrak{m}^n$ given by $t\mapsto a_1, u \mapsto a_2$. Such a map is well-defined since $a_1$ and $a_2$ are nilpotent in $\mathscr{O}_{X,x}$. They fit together to define a map on the inverse limit $f: k[[t,u]] \to \widehat{\mathscr{O}_{X,x}}$. This map is an isomorphism on the associated graded rings, and hence is an isomorphism.
Edit: Consider the isomorphism $f: k[[t,u]] \to \widehat{\mathscr{O}_{X,x}}$ constructed above. The map $\mathscr{O}_{X,x} \to \widehat{\mathscr{O}_{X,x}}$ is defined by taking the inverse limit of the maps $\mathscr{O}_{X,x} \to \mathscr{O}_{X,x}/\mathfrak{m}^n$ over all $n$ and hence maps $a_1$ and $a_2$ to the images of $t$ and $u$. Hence, any element of $k[t,u]$ is mapped to an element of $\mathscr{O}_{X,x}$.
However, the converse, proven only using the hypothesis that $\mathscr{O}_{X,x}$ is regular local, would imply that every regular local ring is isomorphic to a polynomial ring. This is not true. Consider for instance $X = \mathrm{Spec} \, K[[t_1,t_2]]$, which as the spectrum of a local ring has one closed point $x$ corresponding to $(t_1,t_2)$. The local ring $\mathscr{O}_{X,x}$ is equal to $K[[t_1,t_2]]$ and hence is isomorphic via the natural map to its completion.
If $\mathscr{O}_{X,x}$ is locally isomorphic to $\mathbb{A}^2$, then we get that at every point $x$, there is a system of regular parameters which generates $\mathscr{O}_{X,x}$ as a $k(x)$-algebra, which suffices to show the reverse inclusion.