Kernel busy after integrate command

asked 2025-05-03 16:56:54 +0200

updated 2025-05-06 00:51:03 +0200

slelievre gravatar image

I created the following code, but when I run it it tells me "Kernel is busy (interrupt)" and it does not give me the value of x nor the value of the integral.

If I do not add the line integrate((x+1)**(n-k)*(x-1)**k, Mb, 0, 2*pi), the code works.

var('wb w ec eb M Mb')
E = M-ec*sin(M-ec*sin(M-ec*sin(M-ec*sin(M-ec*sin(M-ec*sin(M))))))
Eb = Mb-eb*sin(Mb-eb*sin(Mb-eb*sin(Mb-eb*sin(Mb-eb*sin(Mb-eb*sin(Mb))))))
f = 2*arctan(sqrt((1+ec)/(1-ec))*tan(E/2))
fb = 2*arctan(sqrt((1+eb)/(1-eb))*tan(Eb/2))
x = -cos(wb+fb-w-f)

var('k n')
# Legendrenx(M, Mb) = (1/2**n)*sum((factorial(n)/(factorial(k)*factorial(n-k)))**2*(x+1)**(n-k)*(x-1)**k , k, 0 , n)
integrate ((x+1)**(n-k)*(x-1)**k, Mb, 0, 2*pi)
print(x)
edit retag flag offensive close merge delete

Comments

That means that the integration never terminates, at least for the integrand given in this form. This is also true when trying integration via Maxima (default ?), Giac, Fricas and Mathematica (Wolfram engine, in the latter case).

You are running this in a notebook, right ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2025-05-13 10:01:45 +0200 )edit