# Testing whether an expression is an integer

The following is based on this question which shows mathematically that if

$$a = \sqrt{1 + \sqrt{\frac{152}{27}}}- \sqrt{-1 + \sqrt{\frac{152}{27}}}$$

then

$$a^3 + 5 a$$

is an integer.

In Mathematica, though, the result does not hold:

a = Power[1 + Sqrt[152/27], (3)^-1] - Power[-1 + Sqrt[152/27], (3)^-1];

IntegerQ[a^3 + 5 a]


(* False *)

How can we "prove" or compute the proper result?

• Using IntegerQ[FullSimplify[a^3+5*a]] gives True. Relevant quote from the documentation: "IntegerQ[expr] returns False unless expr is manifestly an integer (i.e. has head Integer)". In the "Possible Issues" section of the documentation, this kind of problem is discussed for GoldenRatio - 1/GoldenRatio. Aug 3 at 23:00
• Thanks. That does it! Aug 3 at 23:05
• I vastly prefer using AlgebraicNumber[] for these sorts of things: IntegerQ[AlgebraicNumber[Power[1 + Sqrt[152/27], 1/3] - Power[-1 + Sqrt[152/27], 1/3], CoefficientList[a^3 + 5 a, a]]]. Aug 3 at 23:06
• A bit disappointing that ResourceFunction["RadicalDenest"][a^3 + 5*a] splats. Aug 3 at 23:27

A couple more ways:

ToNumberField[a^3 + 5a] ∈ Integers

True

AlgebraicIntegerQ[a^3 + 5a] && Exponent[MinimalPolynomial[a^3 + 5a, x], x] == 1

True

• Thanks. Your first solution is particularly valuable. ($+1$) Aug 4 at 20:57
Clear["Global*"]

a = (1 + Sqrt[152/27])^(1/3) - (-1 + Sqrt[152/27])^(1/3);

a^3 + 5 a // RootReduce

(* 2 *)

a^3 + 5 a // FullSimplify

(* 2 *)

• Yep... and then perform IntegerQ`... Aug 3 at 23:48