Re: mathematica:- question ?
- To: mathgroup at smc.vnet.net
- Subject: [mg16622] Re: [mg16525] mathematica:- question ?
- From: BobHanlon at aol.com
- Date: Fri, 19 Mar 1999 12:53:49 -0500
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 3/16/99 6:53:41 PM, alex_punnoose at my-dejanews.com writes: >How do you tell Mathematica that $a > 0$ in for example the following >integral: > >Integrate[Sin[x],{x,0,a}]; > >Similarly, it is sometimes necessary to define that $a$ is Real, or Imaginary, >or whatever ... > Alex, The example which you gave does not require any assumptions about a Integrate[Sin[x],{x,0,a}] 1 - Cos[a] However, for other integrals Integrate[x^n * Exp[-a*x], {x, 0, a}] If[a > 0 && Re[n] > -1, a^(-1 - n)* (Gamma[1 + n] - Gamma[1 + n, a^2]), Integrate[x^n/E^(a*x), {x, 0, a}]] You can either provide the appropriate assumptions Integrate[x^n * Exp[-a*x], {x, 0, a}, Assumptions -> {a > 0, Re[n] > -1}] a^(-1 - n)*(Gamma[1 + n] - Gamma[1 + n, a^2]) SetOptions[Integrate, Assumptions -> {a > 0, Re[n] > -1}]; Integrate[x^n * Exp[-a*x], {x, 0, a}] SetOptions[Integrate,Assumptions -> {}]; (* Reset *) a^(-1 - n)*(Gamma[1 + n] - Gamma[1 + n, a^2]) or you can turn off GenerateConditions Integrate[x^n * Exp[-a*x], {x, 0, a}, GenerateConditions -> False] a^(-1 - n)*(Gamma[1 + n] - Gamma[1 + n, a^2]) SetOptions[Integrate, GenerateConditions -> False]; Integrate[x^n * Exp[-a*x], {x, 0, a}] SetOptions[Integrate, GenerateConditions -> Automatic]; (* Reset *) a^(-1 - n)*(Gamma[1 + n] - Gamma[1 + n, a^2]) Bob Hanlon