I'm integrating a positive function f(t) times sin(t) from 0 to pi/5 and get -38.
Actually f is slightly negative for a short time (smallest value ~ -0.0005), but far from enough to explain this. Here is the code for the function:
NormFact[k_, S_] :=
Sqrt[(4 S - 2 k - 1) (4 S - k) (4 S - k + 1) (k +
1) (k + 2)/(4*Pi*S)];
xi[k_, j_, S_] := (-1)^j*
Binomial[k, j]*(4*S - k - 1)!/((j + 2)!*(4*S - k - j - 1)!);
Ofunc[t_, S_, coeffs_] :=
1 - Cos[t/2]^(4*S) +
coeffs.Table[
NormFact[k, S]*
Sum[xi[k, j, S]*Sin[t/2]^(2*j + 2)*Cos[t/2]^(4*S - 2*j - 2), {j,
0, k}], {k, 0, Length[coeffs] - 1}];
cfs = {-2.6155133, 0.9614036, 0.100279, -0.432464,
0.39887624, -0.2508507, 0.10555472, -0.0007824, -0.0526054,
0.0703274, -0.0688152, 0.05138949, -0.03833719,
0.02062684, -0.0018939, -0.0027808};
And here's the result when I integrate:
In:= Integrate[Ofunc[t, 58.5, cfs]*Sin[t], {t, 0, Pi/5}]
Out:= -38.132 + 0. I
Can anyone see my mistake?
"ReleaseID" /. ("Kernel" /. SystemInformation["Small"])– rcollyer Aug 08 '13 at 16:27NIntegrategives an answer I'm comfortable with (0.13956), and it works fine on v8.0.1, too. So, I'd use that, especially considering the coefficients in your function have vastly different scales, and may be confusing things. – rcollyer Aug 08 '13 at 16:48Integrategoing through slightly different somersaults. Given the coefficient sizes and oscillations, huge numerical error here is not entirely a surprise. – Daniel Lichtblau Aug 08 '13 at 18:06