[Maxima-bugs] [ maxima-Bugs-1044318 ] defint(1/(sin(x)^2+1), x, 0, 3*%pi) wrong

 [Maxima-bugs] [ maxima-Bugs-1044318 ] defint(1/(sin(x)^2+1), x, 0, 3*%pi) wrong From: SourceForge.net - 2006-07-31 03:46:37 ```Bugs item #1044318, was opened at 2004-10-10 21:40 Message generated for change (Comment added) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Lisp Core - Integration Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: defint(1/(sin(x)^2+1),x,0,3*%pi) wrong Initial Comment: INTEGRATE(1/(SIN(x)^2+1),x,0,3*%PI) => 0 Since the integrand is everywhere >= 1/2, the integral cannot be zero -- in fact integrate(1/(sin(x)^2+1),x,q,q+k*%pi) = k*pi/sqrt(2) (real q, integral k) Presumably defint is using the indefinite integral atan(2*tan(x)/sqrt(2))/sqrt(2) inappropriately. ---------------------------------------------------------------------- >Comment By: Robert Dodier (robert_dodier) Date: 2006-07-30 21:46 Message: Logged In: YES user_id=501686 Observed in 5.9.3cvs. I find defint(1/(sin(x)^2+1),x,0,3*%pi); => sqrt(2)*atan(sqrt(2)*tan(3*%pi))/2 -sqrt(2)*atan(sqrt(2)*tan(0))/2 but then ratsimp(%) => 0 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 ```

 [Maxima-bugs] [ maxima-Bugs-1044318 ] defint(1/(sin(x)^2+1), x, 0, 3*%pi) wrong From: SourceForge.net - 2006-07-31 03:46:37 ```Bugs item #1044318, was opened at 2004-10-10 21:40 Message generated for change (Comment added) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Lisp Core - Integration Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: defint(1/(sin(x)^2+1),x,0,3*%pi) wrong Initial Comment: INTEGRATE(1/(SIN(x)^2+1),x,0,3*%PI) => 0 Since the integrand is everywhere >= 1/2, the integral cannot be zero -- in fact integrate(1/(sin(x)^2+1),x,q,q+k*%pi) = k*pi/sqrt(2) (real q, integral k) Presumably defint is using the indefinite integral atan(2*tan(x)/sqrt(2))/sqrt(2) inappropriately. ---------------------------------------------------------------------- >Comment By: Robert Dodier (robert_dodier) Date: 2006-07-30 21:46 Message: Logged In: YES user_id=501686 Observed in 5.9.3cvs. I find defint(1/(sin(x)^2+1),x,0,3*%pi); => sqrt(2)*atan(sqrt(2)*tan(3*%pi))/2 -sqrt(2)*atan(sqrt(2)*tan(0))/2 but then ratsimp(%) => 0 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-1044318 ] defint(1/(sin(x)^2+1), x, 0, 3*%pi) wrong From: SourceForge.net - 2006-09-01 21:12:36 ```Bugs item #1044318, was opened at 2004-10-10 23:40 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Integration Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: defint(1/(sin(x)^2+1),x,0,3*%pi) wrong Initial Comment: INTEGRATE(1/(SIN(x)^2+1),x,0,3*%PI) => 0 Since the integrand is everywhere >= 1/2, the integral cannot be zero -- in fact integrate(1/(sin(x)^2+1),x,q,q+k*%pi) = k*pi/sqrt(2) (real q, integral k) Presumably defint is using the indefinite integral atan(2*tan(x)/sqrt(2))/sqrt(2) inappropriately. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2006-09-01 17:12 Message: Logged In: YES user_id=28849 I think the problem is caused by INFR. I think it's supposed to compute how many full periods and fractional periods are in the integral, but it does it incorrectly. The following replacement: (defun infr (a) (let* ((q (igprt (div a (mul 2 '\$%pi)))) (r (add a (mul -1 (mul q 2 '\$%pi))))) (cons q r))) works much better for this example, and we get 3*pi/sqrt(2), as expected. In the results shown by Robert, ratsimp produces zero because atan is using the principal result, but defint is trying to tell you to be careful by returning atan(sqrt(2)*tan(3*%pi))... ---------------------------------------------------------------------- Comment By: Robert Dodier (robert_dodier) Date: 2006-07-30 23:46 Message: Logged In: YES user_id=501686 Observed in 5.9.3cvs. I find defint(1/(sin(x)^2+1),x,0,3*%pi); => sqrt(2)*atan(sqrt(2)*tan(3*%pi))/2 -sqrt(2)*atan(sqrt(2)*tan(0))/2 but then ratsimp(%) => 0 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-1044318 ] defint(1/(sin(x)^2+1), x, 0, 3*%pi) wrong From: SourceForge.net - 2006-09-05 15:41:22 ```Bugs item #1044318, was opened at 2004-10-10 23:40 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Integration Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: defint(1/(sin(x)^2+1),x,0,3*%pi) wrong Initial Comment: INTEGRATE(1/(SIN(x)^2+1),x,0,3*%PI) => 0 Since the integrand is everywhere >= 1/2, the integral cannot be zero -- in fact integrate(1/(sin(x)^2+1),x,q,q+k*%pi) = k*pi/sqrt(2) (real q, integral k) Presumably defint is using the indefinite integral atan(2*tan(x)/sqrt(2))/sqrt(2) inappropriately. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2006-09-05 11:40 Message: Logged In: YES user_id=28849 Closing this report. The function INFR has been replaced with a new version that works for this case. I've also updated INTSC1 so that it can handle the case where the limits are q and q + k * 2 * %pi, for k a numerical integer. There are still other issues, which we be in a new bug report. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2006-09-01 17:12 Message: Logged In: YES user_id=28849 I think the problem is caused by INFR. I think it's supposed to compute how many full periods and fractional periods are in the integral, but it does it incorrectly. The following replacement: (defun infr (a) (let* ((q (igprt (div a (mul 2 '\$%pi)))) (r (add a (mul -1 (mul q 2 '\$%pi))))) (cons q r))) works much better for this example, and we get 3*pi/sqrt(2), as expected. In the results shown by Robert, ratsimp produces zero because atan is using the principal result, but defint is trying to tell you to be careful by returning atan(sqrt(2)*tan(3*%pi))... ---------------------------------------------------------------------- Comment By: Robert Dodier (robert_dodier) Date: 2006-07-30 23:46 Message: Logged In: YES user_id=501686 Observed in 5.9.3cvs. I find defint(1/(sin(x)^2+1),x,0,3*%pi); => sqrt(2)*atan(sqrt(2)*tan(3*%pi))/2 -sqrt(2)*atan(sqrt(2)*tan(0))/2 but then ratsimp(%) => 0 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1044318&group_id=4933 ```