Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Integrate and Distribution over terms

  • To: mathgroup at
  • Subject: [mg9255] Integrate and Distribution over terms
  • From: Sean Ross <seanross at>
  • Date: Fri, 24 Oct 1997 01:01:08 -0400
  • Sender: owner-wri-mathgroup at

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

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


Integrate[Sign[x-Pi] Sin[x]/(2 Pi),{x,-4,4}] returns


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

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.

  • Prev by Date: Re: mathematica question
  • Next by Date: Computer Algebra in Physics Research
  • Previous by thread: Re: Re: Horse Race Puzzle (fwd)
  • Next by thread: Re: Integrate and Distribution over terms