# Strange Integrate messages / $RecursionLimit being ignored Bug introduced in 10.1.0 and fixed in 10.2.0 The following behavior was observed in Mathematica 10.1 (Windows 64 bit) When attempting to evaluate the following integral, Mathematica outputs several messages which appear to be some sort of internal error leaking out. Integrate[Cos[Sin[x]]^n,{x,0,Pi}]  I tried to resolve the issue by increasing$RecursionLimit, but regardless of what I set it to (including Infinity), the value appears to be ignored as the first error messages still appear and always reference a "Recursion depth of 1024".

If I increase the \$IterationLimit to Infinity, Mathematica appears to honor the value and simply hangs after the first General::stop message is printed.

Evaluating the integral with no limits returns the integral unevaluated without messages. Using different limits has different results depending on the limits:

Integrate[Cos[Sin[x]]^n,{x,0,1}]


returns unevaluated with no messages, whereas

Integrate[Cos[Sin[x]]^n,{x,0,2Pi}]


Seems to run into some internal loop where similar messages are printed over and over (seemingly infinitely).

Does anybody know how to alleviate these errors?

Is there anyway to force Mathematica to honor my recursion limit?

• Welcome to Mathematica.SE! Please never use the bugs tag with your own questions. See here for more info. The tag is meant to be added by someone else after it has been verified as an actual bug by the community. That said, this is clearly a bug IMO (I can reproduce it) so I'm leaving in the tag. Don't expect to be able to fix this yourself. Please report it to Wolfram Support. – Szabolcs Apr 13 '15 at 19:13
• Note: I can reproduce it in 10.1.0 on OS X but not 10.0.2. 10.0.2 does not return a result. – Szabolcs Apr 13 '15 at 19:15
• For odd n -> 1/2^n Pi Tr@ Table[Binomial[n, Floor[n/2] - j ] BesselJ[0, 2 j + 1], {j, 0, Ceiling[n/2]}] – Dr. belisarius Apr 13 '15 at 21:50
• For Even n is very similar – Dr. belisarius Apr 13 '15 at 21:51

Integrate[Cos[Sin[x]]^n, {x, 0, Pi}] // InputForm

• Could you take a look at this question? In 10.1 and 10.2 NSolve does return a result, even with VerifySolutions -> True. But it appears that the system really does not have any solutions. Is this a bug in 10.1 and 10.2? In 10.0 and 9.0 NSolve correctly states that there are no solutions. – Szabolcs Jul 22 '15 at 6:31