# Solve integrals with assumptions?

Posted 2 years ago
1932 Views
|
|
0 Total Likes
|
 Hello! I am a newbie in the Forums... I have read the Guidelines and used the Search and haven't found the answer to this, but just excuse me if this is too easy or explained elsewhere. If you can give me a pointer I will read it from there.I am trying to do an integral in Mathematica. The integral is Integrate[E^(I a x + I b Cos[x] ),{x,0,2 Pi}] Mathematica can't solve this integral and leaves it as an expression. However, this integral has a known solution in terms of Bessel functions, if b is real and a is an integer. For example, if we do  Integrate[E^(I a x + I b Cos[x] )/.a->1,{x,0,2 Pi}] The solution is ConditionalExpression[ 2 I Pi BesselJ[1,b], Element[b,Reals]] Unfortunately, if I use the Assumption that a is an Integer, Mathematica still can't solve the integral. Even more surprising was when I changed the value of a to 3/2 to find out that Mathematica gave me a (complicated) analytical expression. So, it appears that Mathematica knows more about the Integral than it distills from the outcome of the Integrate, but it is only apparent when you force it to calculate given numbers.Now the questions are: How does the Assumptions work internally? Does Mathematica first look for a complete solution of the Integral and then try to match it with the Assumptions? What is the difference when I do the /. command? I guess that it first assigns the value to the variable and then executes the function.Overall: Is there a way of extracting all the information from the integral othere than trying different values?Thanks a lot for your help!
 In this case it's not a big deal, this  Table[{a, Integrate[E^(I a x + I b Cos[x]), {x, 0, 2 Pi}, Assumptions -> b \[Element] Reals]}, {a, 0, 12}] {{0, 2 \[Pi] BesselJ[0, Abs[b]]}, {1, 2 I \[Pi] BesselJ[1, b]}, {2, -2 \[Pi] BesselJ[2, Abs[b]]}, {3, -2 I \[Pi] BesselJ[3, b]}, {4, (2 \[Pi] (b (-24 + b^2) BesselJ[0, b] - 8 (-6 + b^2) BesselJ[1, b]))/b^3}, {5, (2 I \[Pi] (b (-48 + b^2) BesselJ[1, b] - 12 (-16 + b^2) BesselJ[2, b]))/b^3}, {6, ( 2 \[Pi] (b (1920 - 144 b^2 + b^4) BesselJ[0, b] - 6 (640 - 128 b^2 + 3 b^4) BesselJ[1, b]))/b^5}, {7, ( 2 I \[Pi] (b (5760 - 240 b^2 + b^4) BesselJ[1, b] - 24 (960 - 80 b^2 + b^4) BesselJ[2, b]))/b^5}, {8, 1/b^7 2 \[Pi] (b (-322560 + 28800 b^2 - 480 b^4 + b^6) BesselJ[0, b] - 32 (-20160 + 4320 b^2 - 150 b^4 + b^6) BesselJ[1, b])}, {9, 1/b^7 2 I \[Pi] (b (-1290240 + 67200 b^2 - 720 b^4 + b^6) BesselJ[1, b] - 40 (-129024 + 12096 b^2 - 240 b^4 + b^6) BesselJ[2, b])}, {10, 1/b^9 2 \[Pi] (b (92897280 - 9031680 b^2 + 201600 b^4 - 1200 b^6 + b^8) BesselJ[0, b] - 10 (18579456 - 4128768 b^2 + 169344 b^4 - 1920 b^6 + 5 b^8) BesselJ[1, b])}, {11, 1/b^9 2 I \[Pi] (b (464486400 - 27095040 b^2 + 403200 b^4 - 1680 b^6 + b^8) BesselJ[1, b] - 60 (30965760 - 3096576 b^2 + 75264 b^4 - 560 b^6 + b^8) BesselJ[ 2, b])}, {12, 1/b^11 2 \[Pi] (b (-40874803200 + 4180377600 b^2 - 108380160 b^4 + 940800 b^6 - 2520 b^8 + b^10) BesselJ[0, b] - 24 (-3406233600 + 774144000 b^2 - 34836480 b^4 + 501760 b^6 - 2450 b^8 + 3 b^10) BesselJ[1, b])}} shows that up to $a=3$ inclusively the a appears as index of BesselJ. For bigger a seemingly a representation of the result in terms of BesselJ[0,b], BesselJ[1,b] or in terms of BesselJ[1,b], BesselJ[2,b] has been performed. So one tests that  In[34]:= Table[{a, FullSimplify[Integrate[E^(I a x + I b Cos[x]), {x, 0, 2 Pi}, Assumptions -> b \[Element] Reals] - 2 \[Pi] I^a BesselJ[a, b]]}, {a, 0, 12}] Out[34]= {{0, 2 \[Pi] (-BesselJ[0, b] + BesselJ[0, Abs[b]])}, {1, 0}, {2, 2 \[Pi] (BesselJ[2, b] - BesselJ[2, Abs[b]])}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}, {10, 0}, {11, 0}, {12, 0}} In general, this is not instructive In[39]:= FullDefinition[BesselJ] Out[39]= Attributes[BesselJ] ={Listable, NumericFunction, Protected, ReadProtected} Usually a user should and must not become aware of the internals of a product. But you have the product installed and may have a look into where the magic is done, as far as you guess the file names ... In[49]:= FileNames[{"*Bessel*", "*Integrate*"}, \$InstallationDirectory, \[Infinity]] // Length Out[49]= 64 most of them are tutorials, help system, reference pages, configuration.