Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15187 > unrolled thread

Wrong result of Integrate with assumptions -- my fault?

Started byAlain Cochard <Alain.Cochard@unistra.fr>
First post2013-07-18 06:44 +0000
Last post2013-09-11 07:44 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Wrong result of Integrate with assumptions -- my fault? Alain Cochard <Alain.Cochard@unistra.fr> - 2013-07-18 06:44 +0000
    Re: Wrong result of Integrate with assumptions -- my fault? Youngjoo Chung <ychung12@gmail.com> - 2013-09-09 03:53 +0000
    Re: Wrong result of Integrate with assumptions -- my Alex Krasnov <akrasnov@cory.eecs.berkeley.edu> - 2013-09-11 07:44 +0000

#15187 — Wrong result of Integrate with assumptions -- my fault?

FromAlain Cochard <Alain.Cochard@unistra.fr>
Date2013-07-18 06:44 +0000
SubjectWrong result of Integrate with assumptions -- my fault?
Message-ID<ks82sr$jnp$1@smc.vnet.net>
Dear group --

In the following, it seems adding the assumption that w is real spoils
the result:

   res1=Integrate[t*Exp[I w t],{t,a,b}, Assumptions-> a<b] ;
   res2=Integrate[t*Exp[I w t],{t,a,b}, Assumptions-> a<b && Element[w,Reals]];
   Chop[N[res1-res2/.{a->-1, b->2, w->3}]]

gives 0. + 0.691355 I (I tried Mathematica 7, 8, 9 installed on 3 different
GNU/Linux machines).

>From the various tests I did, it seems that the real parts are always
identical while the imaginary parts differ in the case a < 0.

Was this to be expected?  Am I not allowed to make this assumption?

Thank you.



-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France    | Fax:   +33 (0)3 68 85 01 25     

[toc] | [next] | [standalone]


#15388

FromYoungjoo Chung <ychung12@gmail.com>
Date2013-09-09 03:53 +0000
Message-ID<l0jgol$dng$1@smc.vnet.net>
In reply to#15187
Hi,

Actually, none of the assumptions are necessary. Integrate returns the result in the form ConditionalExpresssion[...] in case certain conditions must be met for the result to be valid. Otherwise, it is not necessary to add the Assumptions option.

Nevertheless, res2 is not always correct as you mentioned. After some arithmetic, I observed that Re[res2] is always correct but Im[res2] is correct only when a > 0 and b > 0 regardless of w assuming Abs[a] < Infinity and Abs[b] < Infinity.

Sincerely,
Youngjoo Chung

[toc] | [prev] | [next] | [standalone]


#15411 — Re: Wrong result of Integrate with assumptions -- my

FromAlex Krasnov <akrasnov@cory.eecs.berkeley.edu>
Date2013-09-11 07:44 +0000
SubjectRe: Wrong result of Integrate with assumptions -- my
Message-ID<l0p71d$s2f$1@smc.vnet.net>
In reply to#15187
Consider the following simpler examples (Mathematica 8.0.4):

In:	Expand[ExpToTrig[Integrate[t*E^(I*3*t), {t, a, b}] /. {a -> -1, b -> 2}]]
Out:	(-1/9 - I/3)*Cos[3] + (1/9 - (2*I)/3)*Cos[6] - (1/3 - I/9)*Sin[3] + (2/3 + I/9)*Sin[6]

In:	Expand[Assuming[Element[{a, b}, Reals], Integrate[t*E^(I*3*t), {t, a, b}]] /. {a -> -1, b -> 2}]
Out:	(-1/9 + I/3)*Cos[3] + (1/9 - (2*I)/3)*Cos[6] - (1/3 + I/9)*Sin[3] + (2/3 + I/9)*Sin[6]

The second result is already incorrect.

Alex


On Mon, 9 Sep 2013, Youngjoo Chung wrote:

> Hi,
>
> Actually, none of the assumptions are necessary. Integrate returns the result in the form ConditionalExpresssion[...] in case certain conditions must be met for the result to be valid. Otherwise, it is not necessary to add the Assumptions option.
>
> Nevertheless, res2 is not always correct as you mentioned. After some arithmetic, I observed that Re[res2] is always correct but Im[res2] is correct only when a > 0 and b > 0 regardless of w assuming Abs[a] < Infinity and Abs[b] < Infinity.
>
> Sincerely,
> Youngjoo Chung
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web