Re: Mathematica bug in handling trigonometric functions? (and more)
- To: mathgroup at smc.vnet.net
- Subject: [mg55755] Re: Mathematica bug in handling trigonometric functions? (and more)
- From: dh <dh at metrohm.ch>
- Date: Tue, 5 Apr 2005 05:45:06 -0400 (EDT)
- References: <d2oes5$fhn$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi APC, I tried to simplify the problem a bit. There is definitly a bug that Wolfram should take notice. It would be nice if WRI could give an answer . The folllowing is obviously correct: Sum[Sin[k]*Cos[k + 1], {k, 1, 1}] Out: Cos[2] Sin[1] When we do the same with indefinite summation: Sum[Sin[k]*Cos[k + 1], {k, 1, n}] /. n -> 1 // Simplify // Expand Out: Sin[1]/2 + Cos[2] Sin[1] we get an additional term: Sin[1]/2 !!! Sincerely, Daniel APC wrote: > a)"Sum"-Command > > mathematica 5.1: > > input: Sum[Sin[k]*Cos[k + 1], {k, 1, n}] > output: (1/4)*(Cos[2] - Cos[2 + 2*n])*Csc[1] > > which is obviously incorrect. > > with the more general Sum[Sin[a*k]*Cos[k + 1], {k, 1, n}] i get correct results, though. > > (mathematica 2.2's "SymbolicSum" command has no problems at all) > > another example: > > input: Sum[Log[k]/Exp[k], {k, 1, Infinity}] > output: (-(E*Derivative[1, 0][PolyLog][0, E^(-1)]) + > Derivative[0, 1, 0][LerchPhi][E^(-1), 0, 1])/E > > which is incorrect. -Derivative[1, 0][PolyLog][0, E^(-1)]alone is the correct result, the LerchPhi term is identical so the output could be simplified to "0", which is wrong, of course. there seems to be a problem with "Sum" and derivatives of functions, as > > Sum[Log[k]^2/k^3, {k, 1, Infinity}] > > for example yields an incorrect result under similar circumstances. > > b)"Integrate" command > > input: Integrate[Sqrt[Sin[x] + Cos[x]], x] > output: (2*(Cos[x] + Sin[x] + Null*(1 + Sin[2*x])^(1/4)))/Sqrt[Cos[x] + Sin[x]] > > the output includes a "Null"-term. > > the result for the more general case > > input: Integrate[Sqrt[a*Sin[x] + b*Cos[x]], x] > > is correct, though. > > apparently "Sum" and "Integrate" have problems handling special cases involving trigonometric functions. > please check for yourself. if i'm correct, i can no more trust any "Sum" or "Integrate" results without checking twice. >