Re: Re: Re: May we trust IntegerQ ?
- To: mathgroup at smc.vnet.net
- Subject: [mg107563] Re: [mg107536] Re: [mg107504] Re: [mg107488] May we trust IntegerQ ?
- From: Andrzej Kozlowski <akozlowski at gmail.com>
- Date: Wed, 17 Feb 2010 07:02:43 -0500 (EST)
- References: <201002160853.DAA01363@smc.vnet.net>
This approach can, unfortunately, produce misleading results in
situations when FullSimplify is unable to reduce an expression to an
integer. Take for example this:
IntegerQ[
FullSimplify[ArcCosh[1 + Abs[z]^2/2]/ArcSinh[Abs[z]/2]]]
False
But this is just plain wrong. The expression is in fact equal to 2 (for
z!=0, adding this condition to FullSimplify won't make any difference
of course). Its much better to use
FullSimplify[
Element[ArcCosh[1 + Abs[z]^2/2]/ArcSinh[Abs[z]/2], Integers]]
You won't get the right answer but you won't get the wrong one either -
so you will see that Mathematica is simply unable to settle this. In
fact, FullSimplify can show that the numerator is equal to twice the
denominator:
FullSimplify[(ArcCosh[1 + Abs[z]^2/2] ==
2 ArcSinh[Abs[z]/2]) // TrigToExp]
True
so the quotient is, indeed, the integer 2.
Andrzej Kozlowski
On 16 Feb 2010, at 09:53, Bob Hanlon wrote:
>
> Use FullSimplify in this case
>
> Table[IntegerQ[
> FullSimplify[
> 1/2 (x - Sqrt[-1 + x^2])^(2 x) + 1/2 (x + Sqrt[-1 + x^2])^(2 x)]],
{x, 0,
> 10}]
>
> {True,True,True,True,True,True,True,True,True,True,True}
>
>
> Bob Hanlon
>
> ---- Artur <grafix at csl.pl> wrote:
>
> =============
> Dear Daniel,
> What to do in following case:
> Table[IntegerQ[FunctionExpand[1/2 (x - Sqrt[-1 + x^2])^(2 x) + 1/2 (x
+
> Sqrt[-1 + x^2])^(2 x)]], {x, 0, 10}]
> Best wishes
> Artur
>
>
> danl at wolfram.com pisze:
>>> Procedure: find such x that ChebyshevT[x/2, x] isn't integer
>>> aa = {}; Do[ If[IntegerQ[ChebyshevT[x/2, x]], , AppendTo[aa, x]],
{x, 0,
>>> 20}]; aa
>>> and answer Mathematica is set:
>>> {3, 5, 7, 9, 11, 13, 15, 17, 19}
>>> where occered e.g. number 7
>>> N[ChebyshevT[7/2, 7],100]
>>>=
5042.00000000000000000000000000000000000000000000000000000000000000000\
>>> 0000000000000000000000000000000
>>> evidently is integer 5042
>>> Some comments ?
>>>
>>> Best wishes
>>> Artur
>>>
>>
>> Trust IntegerQ? Mais oui.
>>
>> Documentation Center entry for IntegerQ, first item under More
Information:
>>
>> "IntegerQ[expr] returns False unless expr is manifestly an integer
(i.e.,
>> has head Integer)."
>>
>> Example:
>> In[16]:= IntegerQ[Sin[3]^2 + Cos[3]^2]
>> Out[16]= False
>>
>> For your example, it might be better to use
>> FunctionExpand[ChebyshevT[x/2,x]]. Then try to figure out which cases
>> involving half-integer powers (Puiseux polynomials) will still
evaluate to
>> integers.
>>
>> Daniel Lichtblau
>> Wolfram Research
>
>
- References:
- Re: Re: May we trust IntegerQ ?
- From: Bob Hanlon <hanlonr@cox.net>
- Re: Re: May we trust IntegerQ ?