Re: Integration problem

• To: mathgroup at smc.vnet.net
• Subject: [mg60495] Re: Integration problem
• From: Peter Pein <petsie at dordos.net>
• Date: Sun, 18 Sep 2005 01:15:50 -0400 (EDT)
• References: <200509160936.FAA05066@smc.vnet.net> <dggdma\$gea\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Heidi.Foerster at physics.unige.ch 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:

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

Cos[x0]/E^a

Peter

--
Peter Pein, Berlin
GnuPG Key ID: 0xA34C5A82
http://people.freenet.de/Peter_Berlin/

```

• 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