Forcing a parameter to be integer when using 'Integrate'

Forcing a parameter to be integer when using 'Integrate'

Post by Ian Lining » Sat, 01 Jul 2006 17:39:14


Hello,

I am a mathematica novice, so please excuse me if this question is a
bit dumb...

I would like to solve the integral:


with n integer and a real and positive.
The problem is that I don't know how to tell Mathematica about these
conditions on a and n.

If I explicitly assign an integer value for n (i.e. 4 in this example),
Mathematica solves the integral:


(with a few conditions) and gives the output

(Re[a^(-1)] != 0 || -Im[a^(-1)] >= 0) && ...
... (lots more)...,
(4*(-8*(2 + a^2)*EllipticE[-a^2] +
(4 + a^2)*(4 + 3*a^2)*EllipticK[-a^2]))/(3*a^4),
Integrate[E^((4*I)*x)/Sqrt[1 + a^2*Sin[x]^2],
{x, 0, 2*Pi},
Assumptions -> !((Re[a^(-1)] != 0 || -Im[a^(-1)] < 0)
&& (Re[a^(-1)] != 0 || -Im[a^(-1)] >= 0) && ...)
... (lots more) ...]]

Simlilarly if we pick other integer values for n.

The question is, how to get a generic formula in terms of a and n?

Can anybody help please?

Many thanks,
Ian
 
 
 

Forcing a parameter to be integer when using 'Integrate'

Post by Jean-Marc » Sun, 02 Jul 2006 18:28:24


Use Assumptions. For instance

Integrate[E^((n*I)*x)/Sqrt[1 + a^(2)*Sin[x]^(2)],
{x, 0, 2*Pi}, Assumptions -> {Element[n, Integers], a > 0}]

HTH,
Jean-Marc

 
 
 

Forcing a parameter to be integer when using 'Integrate'

Post by Bill Row » Sun, 02 Jul 2006 18:48:46

On 6/30/06 at 4:14 AM, XXXX@XXXXX.COM (Ian Linington)








There are a variety of ways to get Mathematica to suppress generation of assumptions. Probably what you want is to use Assuming or Assumptions,

i.e.

Assuming[{Element[n,Integers] a>0}, Integrate[...

or

Integrate[...., Assumptions->{Element[n, Integers], a>0}]

Note, I am assuming usage of Mathematica version 5.2 here. The function Assuming was not introduced until version 5.