       nasty,nasty bug?

• To: mathgroup at smc.vnet.net
• Subject: [mg25955] nasty,nasty bug?
• From: Shaun Roe <shaun.roe at cern.ch>
• Date: Tue, 14 Nov 2000 03:46:49 -0500 (EST)
• Organization: CERN - European Laboratory for Particle Physics
• Sender: owner-wri-mathgroup at wolfram.com

```I'm having fun calculating occupancies in a silicon detector system; try
this:

Clear["Global`*"];
Occ = n*Integrate[s[V]*p[V], {V, -Infinity,
Infinity}]

Var = Occ*(1 - Occ) +
n*(n - 1)*Integrate[p[V]^2*s[V], {V, -Infinity, Infinity}]

s[V_] := 1/(s*Sqrt[2*Pi])*Exp[-((V0 - V)^2/(2*s^2))]

p[V_] := 1/2*Erfc[V/(\[Sigma]*Sqrt)]

nomVals = {V0 -> 0, n -> 2, s -> 1, \[Sigma] -> 1}

Plot[p[x]*s[x] /. nomVals, {x, -2, 2}]

N[Integrate[p[x]*s[x], {x, -20, 20}] /. nomVals]

N[Integrate[p[x]*s[x], {x, -50, 50}] /. nomVals]

N[Integrate[p[x]*s[x], {x, -Infinity, Infinity}] /. nomVals]

The integral evaluates to the same value (0.5) for arbitrarily large limits,
but certainly not for Infinity. Feature or bug? It certainly tripped me up.

```

• Prev by Date: Two problems with Mathematica 4 on G4
• Next by Date: Re: how to differentiate a list?
• Previous by thread: Re: Two problems with Mathematica 4 on G4