Why is cotangent space $T_x^{*}(X) =\frac{C^{\infty}(X)}{T_x(X)^{\perp}}$? Definitions:

Given a smooth manifold $X$ of dimension $n$, a tangent space $T_x(X)$ of $X$ at a point $x$ is vector space of all tangent vectors at $x$. Cotangent space $T_x^{*}(X)$ is defined to be dual space of $T_x(X)$.

I don't quite understand the proof of the following:
$$T_x^{*}(X)= \frac{C^{\infty}(X)}{<1>_\mathbb{R}\oplus I_x^2}$$
where $I_x^2$ is an vector subspace generated by elements of the form $ab$ where $a,b$ are $C^{\infty}$ functions vanishing at $x$.
The first part of proof goes on as follows:

Since $T_x(X)\subset C^{\infty}(X)^{*}$, there is a natural isomorphism $T^{*}_x(X)=\frac{C^{\infty}}{W}$ where $W$ is the annihilator of $T_x(X)$ in $C^{\infty}(X)$, and the dual pairing $(a+W,v)\mapsto v(a)$.

Okay, I see that $T_x(X)$ is finite dimensional, so I'm sure there are quite useful linear algebras that can be done here. But I've never seen a general theorem asserting isomorphism of this kind. How is this estabilishied?
The next bit:

Working under local coordinates, $T_x(X)$ is spanned by $\frac{\partial}{\partial x_i}$ so $W$ is the kernel of the map $f\mapsto \left.\left(\frac{\partial f}{\partial x_1},\cdots,\frac{\partial f}{\partial x_n}\right)\right\vert_x. $Therefore by Taylor's theorem $W=<1>_\mathbb{R} \oplus I^2_x$

I can understand up to "therefore" bit. After that, I'm completely lost.
 A: For this problem, you need more than abstract linear algebra. Namely, you need the following.
Lemma: Let $f:\mathbb{R}^n\to\mathbb{R}$ be smooth with $f(0)=0$. Then there are smooth functions $g_1,\ldots,g_n:\mathbb{R}^n\to\mathbb{R}$, such that$$f=\sum x_ig_i,$$where $x_1,\ldots,x_n:\mathbb{R}^n\to\mathbb{R}$ denote the standard coordinate projections. Furthermore, the functions $g_1,\ldots,g_n$ satisfy$$g_i(0)=\frac{\partial f}{\partial x^i}(0).$$
To prove the lemma, let $y=(y_1,\ldots,y_n)\in\mathbb{R}^n$ and write $$f(y)=\int_0^1\frac{d}{dt}f(ty)dt=\int_0^1\sum y_i\frac{\partial f}{\partial x^i}(ty)dt=\sum y_i\int_0^1\frac{\partial f}{\partial x^i}(ty)dt.$$The lemma follows.
And now, to the posted problem. We certainly have a linear map $$D:C^\infty(X)\to T_x^*X,\quad f\mapsto df_x.$$We need to prove that $D$ is surjective, and that its kernel is $\mathbb{R}+I_x^2.$ (Did you remember the surjective part while posting your question? Or did you just assume $(C^\infty)^{**}=C^\infty$? I'm not sure about this last equality). This way or another, surjectivity of $D$ is not hard. Indeed, let $U$ be a coordinate neighborhood of $x$. So any covector at $x$ can be represented by a linear (with respect to the coordinates) function $U\to\mathbb{R}$. This function can then be extended to all $X$ using a bump function. The differential at $x$ remains unchanged through this process.
We now show $\ker D=\mathbb{R}+I_x^2$. With no doubt, the subspace consisting of constant functions (denoted here abusively by $\mathbb{R}$) is in the kernel. The fact that $I_x^2$ is contained in the kernel follows immediately from the Leibniz rule. So we have shown $\mathbb{R}+I_x^2\subset\ker D$. To show the other inclusion, let $f\in\ker D$. That is, $df_x=0$. Then the function $f'=f-f(x)$ is also in the kernel and satisfies $f'(x)=0$. Let $U$ be a coordinate neighborhood. By the above lemma, there are smooth functions $g_i:U\to\mathbb{R}$ such that $$f'|_U=\sum x_ig_i.$$Moreover, each $g_i$ vanishes at $x$, as $df'_x=df_x=0$. Note that this solves the local problem. The coordinate functions $x_1,\ldots,x_n$, as well as the functions $g_1,\ldots,g_n$, can now be extended to all $X$ using (again) a bump function. This way, the equality $$f'=\sum x_ig_i$$ continues to hold (only) in a neighborhood of $x$. Write $$h=f'-\sum x_ig_i.$$ So $h$ vanishes in a neighborhood of $x$, and it is easy to write $h=h_1h_2$, where $h_1,h_2\in I_x$. This shows $f\in\mathbb{R}+I_x^2$ and completes our proof.
A: The abstract result in linear algebra that's being used is the following:
If you have a vector space $V_1 \subset V_2$, then the restriction map $V_2^\vee \to V_1^\vee$ induces an isomorphism $V_1^\vee = V_2^\vee/\text{Ann}(V_1)$. (It's the definition of the annihilator that the kernel of the restriction map is the annihilator. For the surjectivity, use the lemma that any basis of $V_1$ can be extended to a basis of $V_2$ (which I guess needs the axiom of choice at this level of abstraction, although probably not in your concrete case).
The Taylor's theorem argument is that a multivariable function which vanishes at the origin, such that all of the partials vanish, is approximated up to a cubic error term by a quadratic function.
