MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Integrating Abs[Sin[]^2]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39073] Re: Integrating Abs[Sin[]^2]
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Sun, 26 Jan 2003 18:44:15 -0500 (EST)
  • References: <b10d7p$moh$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Dana DeLouis" <delouis at bellsouth.net> wrote:
> k = a + b*I;
> Integrate[Abs[Sin[k*z]]^2, {z, 0, 1}]
>
> This returns what you expected?
>
> ((-b)*Sin[2*a] + a*Sinh[2*b])/(4*a*b)

Right, assuming that we expected Mathematica to assume that a and b are
nonzero reals.

> However, this only works because you were lucky in picking the variable
> a & b that come before the letter x in the Alphabet
> If you had picked variable names that begin with y & z, which come after
> x in the alphabet, then your results should be much different.

I know the bug you're referring to, of course. It was discussed in this
group not long ago. But, it doesn't seem to me that this particular
integral suffers from that bug.

> Let's see...
>
> removeall
> "All Global` variables Removed!"
>
> k = y + I*z;
>
> Integrate[Abs[Sin[k*z]]^2, {z, 0, 1}]
>  
>  (Sqrt[2*Pi]*y*Erf[Sqrt[2]] + Sqrt[2*Pi]*y*Erfi[Sqrt[2]] -
> 4*Sin[2*y])/(16*y)

But you have -- unintentionally, I suppose -- made the imaginary part of
k the same as the variable of integration! As such, I suspect that the
result returned by Mathematica is correct (under suitable assumptions).

I think that perhaps you had instead intended to use

  k = y + I*z; Integrate[Abs[Sin[k*x]]^2, {x, 0, 1}]

which gives a result which _is correct_ if y and z are nonzero reals.

David Cantrell


  • Prev by Date: Re: Problem with Limits; basic calculus
  • Next by Date: Re: Maximizing the BasicInput.nb palette
  • Previous by thread: Re: Integrating Abs[Sin[]^2]
  • Next by thread: Re: Re: Integrating Abs[Sin[]^2]