Let $M$ be a smooth manifold and $p \in M$. The tangent space at $p$, denoted $T_p M$, is defined as the space of derivations at $p$, i.e., linear maps

$$ v : C^\infty(M) \to \mathbb{R} $$

satisfying the Leibniz rule:

$$ v(fg) = v(f)\cdot g(p) + f(p)\cdot v(g) \quad \text{for all } f, g \in C^\infty(M). $$

The cotangent space at $p$, denoted $T_p^* M$, is the dual space:

$$ T_p^* M := \operatorname{Hom}(T_p M, \mathbb{R}), $$

i.e., the space of linear functionals $\omega : T_p M \to \mathbb{R}$. Elements of $T_p^* M$ are called 1-forms at $p$.

On $\mathbb{R}^n$, equipped with coordinates $(x^1,\dots,x^n)$, the canonical basis of the tangent space is $\left{ \frac{\partial}{\partial x^i} \right}$, and the dual basis of the cotangent space is ${dx^i}$, defined by

$$ dx^i\left(\frac{\partial}{\partial x^j}\right) = \delta^i_j. $$

Thus, any tangent vector $v \in T_p \mathbb{R}^n$ can be written as

$$ v = \sum_i v^i \frac{\partial}{\partial x^i}, \qquad \text{and any } \omega \in T_p^* \mathbb{R}^n \text{ as } \omega = \sum_i \omega_i, dx^i, $$

with pairing given by

$$ \omega(v) = \sum_i \omega_i v^i. $$

Any smooth function $f : M \to \mathbb{R}$ defines a differential at $p$, denoted

$$ df_p \in T_p^* M, $$

via

$$ df_p(v) := v(f). $$

This coincides with the directional derivative of $f$ at $p$ along $v$, and hence $df_p$ is a 1-form encoding the infinitesimal variation of $f$.

In coordinates, this corresponds to

$$ df_p = \sum_i \frac{\partial f}{\partial x^i}(p), dx^i, $$

so that for any $v = \sum_i v^i \frac{\partial}{\partial x^i}$, we recover

$$ df_p(v) = \langle \nabla f(p), v \rangle. $$