Integrate and Distribution over terms
- To: mathgroup at smc.vnet.net
- Subject: [mg9255] Integrate and Distribution over terms
- From: Sean Ross <seanross at worldnet.att.net>
- Date: Fri, 24 Oct 1997 01:01:08 -0400
- Sender: owner-wri-mathgroup at wolfram.com
This problem came out of Mark Deckers experimentation with the UniformDistribution probability density function. (which returns a function with Sign's in it) One of the basic lessons I learned in calculus is that Integrate[f[x]+g[x]]=Integrate[f[x]]+Integrate[g[x]]. I have an example where it appears that Mathematica hasn't figured that lesson out yet. Integrate[Sign[x] Sin[x]/(2 Pi),{x,-4,4}] returns 1/Pi-Cos[4]/Pi. Integrate[Sign[x-Pi] Sin[x]/(2 Pi),{x,-4,4}] returns -1/Pi-Cos[4]/Pi. But Integrate[Sign[x] Sin[x]/(2 Pi)-Sign[x-Pi] Sin[x]/(2 Pi),{x,-4,4}] takes about 5 times as long as either of the two preceding integrals and eventually returns itself. ie Mathematica 3.0 can't do it. It is as if Integrate didn't know it was supposed to distribute itself over the terms. If I manually tell Integrate to distribute itself over the terms Distribute[(Integrate[#1, {x, -4, 4}] & )[(Sign[x]*Sin[x])/(2*Pi) - (Sign[-Pi + x]*Sin[x])/(2*Pi)]] then it still takes a long time, but returns the correct answer, 2/Pi. Am I correct that Integrate does not automatically distribute itself over the terms or is there another explanation for this behavior? Is there some option or package that corrects this seeming flaw? Thanks for any insight you could offer.