Re: Simple integral over special functions---HOW?
- To: mathgroup@smc.vnet.net
- Subject: [mg12645] Re: [mg12565] Simple integral over special functions---HOW?
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Sat, 30 May 1998 17:36:37 -0400
- References: <199805232211.SAA02174@smc.vnet.net.>
Michael A. Morrison wrote: > > Hi. I have repeatedly run into trouble trying to get Mathematica to > evaluate analytically simple integrals involving special functions. For > example, the following integral has a simple analytic form: > Integrate[LegendreP[n,x]/Sqrt[1-x^2],{x,-1,+1}] When I enter the > above into Mathematica, it returns the integral unevaluated unless I > specify a value for n. Figuring that the problem was that Mathematica > didn't realize that n is a non-negative integer, I did the following: > n/: IntegerQ[n] = True; > Integrate[LegendreP[n,x]/Sqrt[1-x^2], {x,-1,+1}, Assumptions -> > n >= 0] > Again, Mathematica returned the integral unevaluated, along with the > assumption. > It's as though the information that n is an integer in the Global` > context doesn't get communicated to the Integrate command. Can anyone > tell me (a) whether the above method fully specifies n as an integer in > all such situations (I have other failures where function definitions > seem unaware of such a specification) and if not, how to properly > specify a symbol as an integer and (b) how to make Integrate evaluate > integrals such as the example above? > Many thanks for considering this question. -- > Michael A. Morrison > Dept. Physics & Astronomy > University of Oklahoma > Norman, OK 73019 > Phone: 405 325-3961 > FAX: 405 325-7557 > EMAIL: morrison@mail.nhn.ou.edu > WEB PAGE: http://www.nhn.ou.edu/~morrison One of the "weakness" or "features" of Mathematica, depending on your point of view, is the absence of any variable typing. As a result, there is no convenient way to specify that a number is real or integer or complex or greater than 2, unless it is built in to the function, like Integrate. Even so, aside from specifying some function satisfied by integers, such as Sin[n x]==0 or that Mod[n,1]==0, I can't think of any way to make such an assumption. Even so, these kinds of assumptions don't help Integrate know what to do. I again renew a plea for true, object oriented data typing in a future version of mathematica, meaning that there is some way of specifying general data types and assumptions about symbols that every function in the language would know what to do with and react appropriately. No, I am not volunteering to figure out how to do it.
- References:
- Simple integral over special functions---HOW?
- From: "Michael A. Morrison" <morrison@phyast.nhn.ou.edu>
- Simple integral over special functions---HOW?