MathGroup Archive 2005

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

Search the Archive

Re: Integration problem

Heidi.Foerster at schrieb:
> Hi,
> I have a periodic function
> f=1\(2pi) (1-e^{-2a})/(1-2e^{-a}cos(x-x0)+e^{-2a}), and I want to
> calculate the first Fourier coefficient, which corresponds to
> Integrate[f cos(x),{x,0,2pi}].
> The result mathematica tells me is -Cos[x0] Sinh[a].
> (The correct result would be Cos[x0] e^{-a}.)
> If I set x0 to zero, I get the correct result e^{-a}:
> Simplify[Integrate[(f /. x0 -> 0) Cos[x], {x, 0, 2 \[Pi]}], a > 0]
> e^{-a}
> The problem is, that for x0=0 both outputs don't match.
> Can anyone tell me what's wrong?
> Heidi
Hello Heidi,

 it seems, Mathematica has difficulties to select the correct branch(es)
 while integrating. With a little luck, one succeeds with:

  TransformationFunctions -> {PowerExpand, Automatic}];
a0 = Integrate[f*Cos[x], {x, 0, 2*Pi},
  Assumptions -> a>0 && Element[x0,Reals]]



Peter Pein, Berlin
GnuPG Key ID: 0xA34C5A82

  • Prev by Date: Re: NonlinearFit - Logistic Function-CalcCenter3
  • Next by Date: probability with simulation
  • Previous by thread: Integration problem
  • Next by thread: Re: solve for a squared variable