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?
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. $\endgroup$n
->1/2^n Pi Tr@ Table[Binomial[n, Floor[n/2] - j ] BesselJ[0, 2 j + 1], {j, 0, Ceiling[n/2]}]
$\endgroup$n
is very similar $\endgroup$