Message Boards Message Boards

0
|
1538 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Integrate error: Recursion depth of 1024 exceeded?

Posted 1 year ago
Integrate[1/(1-a * cos(p)),{p,0,2*pi}]

The answer is: 2*pi/sqrt(1-a^2) valid for a^2<1

But I get the following error:

$RecursionLimit
:Recursion depth of 1024 exceeded.

Out[1]=
TerminatedEvaluation[RecursionLimit]
POSTED BY: Daniel McGregor
2 Replies

I am unable to replicate this behavior in version 13.2. Is what you show the exact input used? If not, please post the actual code.

POSTED BY: Daniel Lichtblau
Posted 1 year ago

Mathematica quietly, perhaps without you even realizing it, keeps a hidden copy of all the past assignments you might have made since you opened Mathematica this latest time.

That means it doesn't have to take the time to recalculate something that you already did.

That also means, if you didn't realize this was happening, that you can get puzzling results. I'm guessing you might have previously assigned something to a and or p

Try restarting Mathematica and enter just

Integrate[1/(1-a * cos(p)),{p,0,2*pi}]

and see if the error goes away

If you want to tell it that a^2<1 for this integral then

Integrate[1/(1-a * Cos[p]),{p,0,2*Pi},Assumptions->a^2<1]

will do that

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract