Discrepancy between Integrate and NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg83385] Discrepancy between Integrate and NIntegrate
- From: chuck009 <dmilioto at comcast.com>
- Date: Mon, 19 Nov 2007 06:11:54 -0500 (EST)
I first use Integrate and then evaluate the results with n=3 and the limits t=pi and t=0. I then numerically evaluate the same integrand and the results are very different. Can anyone help me with this problem?
Clear[n]
val1 = n*Pi*I*Integrate[(Cos[n*Pi*Exp[I*t]]/
Cosh[n*Pi*Exp[I*t]])*Exp[I*t], t]
N[(val1 /. {n -> 3, t -> Pi}) - (val1 /. {n -> 3, t -> 0})]
n = 3;
i1 = NIntegrate[n*Pi*I*(Cos[n*Pi*Exp[I*t]]/Cosh[n*Pi*Exp[I*t]])*
Exp[I*t], {t, 0, Pi}]
-1.2522017302861566 + 0.*I
7757.4213022137155 + 0.*I