Given an arbitrary radical expression $a$ whose minimal polynomial over $\mathbb{Q}$ is known to be $P(x)$, $P(x^n)$ is an annulling polynomial for $\sqrt[n]{a}$, where $n\in\mathbb{N}$. When $P(x^n)$ is not irreducible, is there an algebraic way to determine which factor of $P(x^n)$ is the minimal polynomial of $\sqrt[n]{a}$ over $\mathbb{Q}$? Or is it in general necessary to do numerical approximations of each factor evaluated at $\sqrt[n]{a}$ and see which result is closest to zero?
In some sufficiently simple cases it would of course be possible to evaluate the factors algebraically rather than numerically, but in general I'm not aware of a set of algebraic simplifications that are guaranteed to determine whether an expression equals zero.
More context: I'm writing a program into which the user can enter any radical expression. The program returns the simplest form of the expression it can find. During the course of the computation, it's sometimes necessary to find minimal polynomials of radical expressions, the specifics of which depend on what the user entered. When the program has to solve the problem this question is about, it has the value of $n$, it has a representation of $a$ as essentially a binary tree with integers for leaves and arithmetic operations at the nodes, and it has the coefficients of $P(x)$.