# Guessing a radical expression from a decimal expansion

Is there a function in Maple or Mathematica that takes a truncated decimal expansion, and will try to guess at the value in terms of radicals? Can I use the gfun package in Maple for this? Thanks for any help or comments.

-

Is there a function in Maple or Mathematica that takes a truncated decimal expansion, and will try to guess at the value in terms of radicals?

The old versions of Mathematica had Recognize.m (but this generates the minimal polynomial instead of the algebraic number itself), while newer versions now have the RootApproximant[] function. This can be used in conjunction with ToRadicals[].

As a neat example, here's where I use RootApproximant[] to guess at an algebraic representation of a special value of the modular lambda function:

RootApproximant[N[ModularLambda[I Sqrt[5]]]]
Root[1 - 72*#1 + 88*#1^2 - 32*#1^3 + 16*#1^4 & , 1, 0]

1/2 - Sqrt[-2 + Sqrt[5]]


which matches the results of formula 15 in the MathWorld link, while

RootApproximant[N[ModularLambda[I Sqrt[1/2]]]]
-2 + 2*Sqrt[2]


matches formula 35.

-

Apparently it can be done, though not quite in the way you ask. Get very high precision accuracy for some number $x,$ then make a vector (list) out of $1,x,x^2, x^3, \ldots, x^n$ for some not large $n.$ You may then ask for an integer relation among these $(n+1)$ numbers, which gives you the coefficients of a polynomial for which $x$ is a root. In case you chose $n$ too large, ask to factor the polynomial over the integers, to get the lowest degree polynomial for which $x$ is a root. From that information you may, with some creativity, calculate an expression for $x$ in terms of radicals. This final step will only give satisfactory results in very special circumstances.

http://mathworld.wolfram.com/IntegerRelation.html

-