TITLE: Computation of a minimal polynomial
QUESTION [8 upvotes]: It is relatively easy (but sometimes quite cumbersome) to compute the minimal polynomial of an algebraic number $\alpha$ when $\alpha$ is expressible in radicals. For example, the simple query

"minimal polynomial 2^(1/5)*(1-exp(2*pi*i/5))"

to Wolfram Alpha will compute the minimal polynomial of $\sqrt[5]{2}\left(1-\exp\left(\frac{2\pi i}{5}\right)\right)$. However, I do not know how to compute a minimal polynomial of an algebraic number that is not expressible in radicals. Moreover, I want to compute a minimal polynomial of linear combinations of algebraic numbers.
For example, take $f(x) = x^5 - x + 1$. This polynomial is irreducible, has Galois group $S_5$, which is not solvable, so by Abel-Ruffini Theorem the roots of $f(x)$ are not expressible in radicals. I want to take two distinct roots of $f(x)$, say $\alpha_1$ and $\alpha_2$, and compute the minimal polynomial $g(x)$ of $\alpha_1 - \alpha_2$. I know how to do this algebraically, because
$$g(x) = \prod\limits_{\substack{1 \leq i, j \leq 5,\\i\neq j}}\left(x - (\alpha_i - \alpha_j)\right),$$
but the computation just seems too painful. Is there a function in Sage, or Mathematica, or Maple, or PARI/GP, that allows to find $g(x)$?

REPLY [3 votes]: SymPy code :
from sympy import *

x,y = symbols('x y')
roots = solve(x**5 - x + 1)
print(minimal_polynomial(roots[0] - roots[1], y))

gives :
y**20 - 10*y**16 - 95*y**12 + 625*y**10 - 40*y**8 + 3750*y**6 + 400*y**4 + 5000*y**2 + 2869