Ask Your Question
3

Indefinite integral is incorrect

asked 2018-10-26 14:08:37 +0100

proy87 gravatar image

updated 2023-01-09 23:59:48 +0100

tmonteil gravatar image

indefinite_integral(sqrt(1+cos(x)**2), x).full_simplify() gives 1/6*sin(x)^3, which is incorrect.

edit retag flag offensive close merge delete

Comments

1

Where did you get the indefinite_integral function ?

tmonteil gravatar imagetmonteil ( 2018-10-26 14:31:50 +0100 )edit

in 8.5.b0:

sage: integral(sqrt(1+cos(x)**2), x).full_simplify()
1/6*sin(x)^3
FrédéricC gravatar imageFrédéricC ( 2018-10-26 15:16:28 +0100 )edit

@tmonteli, I use sage 8.1

proy87 gravatar imageproy87 ( 2018-10-26 17:02:46 +0100 )edit

Using integral(sqrt(1+cos(x)**2), x).full_simplify() as suggested still results in an answer which is incorrect, doesn't it? This is a nonelementary integral. See here or here

dazedANDconfused gravatar imagedazedANDconfused ( 2018-10-26 18:41:45 +0100 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2018-10-26 22:40:40 +0100

Emmanuel Charpentier gravatar image

updated 2018-10-27 19:01:01 +0100

slelievre gravatar image

This is a bug. Furthermore, it is not a maxima bug, as it is often the case. Here, Sage truly screws things up itself:

  • Maxima doesn't give a false answer:

    sage: maxima.integrate(sqrt(1+cos(x)^2),x).sage()
    integrate(sqrt(cos(x)^2 + 1), x)
    
  • When one tries to "ease" the problem,

    • maxima doesn't recognize the "obvious", but does not give a false answer:

      sage: maxima.integrate(sqrt(1-m*sin(x)^2),x).sage()
      integrate(sqrt(-m*sin(x)^2 + 1), x)
      
    • Sage does:

      sage: integrate(sqrt(1-m*sin(x)^2),x)
      1/4*m*x - 1/8*m*sin(2*x)
      

BTW: what is expected:

sage: elliptic_e(x,1/2).diff(x)
sqrt(-1/2*sin(x)^2 + 1)

One can easily check that sympy, giac and fricas all fail to integrate, but that none of them gives misleading "answers".

This one does not seem to be related to existing indefinite integral bugs, and is an original, genuine, Sage-specific one. Reported as Trac #26563.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-10-26 14:08:37 +0100

Seen: 472 times

Last updated: Oct 27 '18