Fw: Integrate...
- To: mathgroup at smc.vnet.net
- Subject: [mg44304] Fw: Integrate...
- From: "Christos Argyropoulos M.D." <argchris at otenet.gr>
- Date: Wed, 5 Nov 2003 10:00:27 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, I think the problem goes deeper than simply mixing symbolic/numerical stuff. Try symbolic integration of the original function to get: In[9]:= Integrate[Abs[ Cos[r] + Sin[r]], {r, a,b}] Out[9]= \!\(\((\(-a\) + b)\)\ \((\(-\(\(Cos[a]\ \@\((Cos[a] + Sin[a])\)\^2 - Sin[a]\ \@\((Cos[a] + Sin[a])\)\^2\)\/\(\((a - b)\)\ \((Cos[a] + Sin[a])\)\)\)\) + \(Cos[b]\ \@\((Cos[b] + Sin[b])\)\^2 - \ Sin[b]\ \@\((Cos[b] + Sin[b])\)\^2\)\/\(\((a - b)\)\ \((Cos[b] + Sin[b])\)\))\ \)\) Simplification of the result gives: \!\(\(\((Cos[a] - Sin[a])\)\ \@\(1 + Sin[2\ a]\)\)\/\(Cos[a] + Sin[a]\) + \ \(\((\(-Cos[b]\) + Sin[b])\)\ \@\(1 + Sin[2\ b]\)\)\/\(Cos[b] + Sin[b]\)\) Results of the original, simplified versions and the numerical integration agree for 0<=a<=2.35 and 0<=b<2.35 After they diverge dramatically. I suspect this is a bug somewhere inside Integrate, but I do not have the guts to evaluate the integral by hand to see, if the expression returned for symbolic a,b are correct. Any ideas? Christos Argyropoulos Patras Greece ----- Original Message ----- From: "Sampo Smolander" <sampo.smolander+news at helsinki.fi> To: mathgroup at smc.vnet.net Subject: [mg44304] Integrate... > Does anybody know why > > Integrate[Abs[1.0*Cos[r] + 1.0*Sin[r]], {r, 2.35, 2.36}] > > gives > > -2.82839 > > whereas without those 1.0's, > > Integrate[Abs[Cos[r] + Sin[r]], {r, 2.35, 2.36}] > > gives the correct > > 0.000037373 > > ? > > (I'm running Mathematica 4.1 on win98.) > > -- > Sampo Smolander ............... http://www.cs.helsinki.fi/u/ssmoland/ > Rolf Nevanlinna Institute, University of Helsinki ................... >