In early algebra lessons, we are taught some algorithms to rewrite a fraction (in $\mathbb{Q}$) with roots in the denominator as another fraction with no roots (i.e. an integer) in the denominator. This procedure is called "rationalization". For instance:
- a fraction of the form $\frac{1}{\sqrt{a}}$ can be rationalized as follows: $$\frac{1}{\sqrt{a}} = \frac{1}{\sqrt{a}} \cdot \frac{\sqrt{a}}{\sqrt{a}} = \frac{a}{\sqrt{a}} $$
- a fraction of the form $\frac{1}{a + \sqrt{b}}$ can be rationalized as: $$\frac{1}{a + \sqrt{b}} = \frac{1}{a + \sqrt{b}} \cdot \frac{a - \sqrt{b}}{a - \sqrt{b}} = \frac{a - \sqrt{b}}{a^2 - b}$$
- etc.
I am looking for an algorithm for the following generalized version of this problem.
Let $E/F$ be a field extension, and let $\alpha \in E$ be algebraic over $F$. Consider the field $F(\alpha)$. Let $n$ be the algebraic degree of $\alpha$ over $F$; then we know that an $F$-basis of $F(\alpha)$ is $\{1, \alpha, \ldots, \alpha^{n - 1}\}$. Given an element $x \in F(\alpha)$ (which can be written as $$x = \sum_{i = 0}^{n - 1} x_i\alpha^i$$ for some unique $x_i \in F$), how can we find the coefficients $y_i \in F$ such that $$y := \sum_{i = 0}^{n-1} y_i\alpha^i \in F(\alpha) $$ is the multiplicative inverse of $x$ (i.e. $x^{-1} = y$)?
(What I mean by algorithm here is a constructive recipe to find the coefficients of the inverse, assuming that we know how to compute the minimal polynomial of $\alpha$ over $F$.)
Rationalization (with a single root) is indeed a special case of this problem: it's the case where $E = \mathbb{R}$, $F = \mathbb{Q}$ and $\alpha$ is some irrational root of an integer. For instance, the second example above consists of $\alpha = \sqrt{b}$ (which has algebraic degree 2 over $\mathbb{Q}$) with $x = a + \sqrt{b}$, and finds $y = \frac{a}{a^2 - b} - \frac{1}{a^2 - b}\sqrt{b}$.
In this question, the accepted answer proves that $\mathrm{span}_F \{1, \alpha, \ldots, \alpha^{n-1}\}$ is indeed a field, proving the existence of multiplicative inverses, but it doesn't explicitly construct the inverse as a linear combination of $\{1, \alpha, \ldots, \alpha^{n-1}\}$. In other words, I'm looking for a constructive proof of the existence of multiplicative inverses in $\mathrm{span}_F \{1, \alpha, \ldots, \alpha^{n-1}\}$.
P.S.
An even more general problem would be the following:
Let $E/F$ be a field extension, and let $\alpha_1, \ldots, \alpha_m \in E$ be algebraic over $F$ and linearly independent in the $F$-vector space $E$. Consider the field $F(\alpha_1, \ldots, \alpha_m)$. Let $n_j$ be the algebraic degree of $\alpha_j$ over $F$ for every $j$; then we know that an $F$-basis of $F(\alpha_1, \ldots, \alpha_m)$ is: $$ \mathcal{B} := \left\{ \prod_{j = 1}^m \alpha_j^{k_j} \mid \forall j \quad 0 \le k_j < n_j \right\} $$ Given an element $x \in F(\alpha_1, \ldots, \alpha_m)$ with coorinates $[x]_\mathcal{B} = (x_{0, \ldots, 0}, \ldots, x_{n_1, \ldots, n_m})$ how can we find the coordinates of $x^{-1}$ (which is again in $F(\alpha_1, \ldots, \alpha_m)$) with respect to the basis $\mathcal{B}$?
But I guess an algorithm for this can be obtained from an algorithm of the case with $m = 1$ considering that $F(\alpha, \beta) = \left(F(\alpha)\right)(\beta)$ (see here).