[Maxima-bugs] [ maxima-Bugs-541030 ] integrate(sqrt(x+1/x-2),x,0,1) wrong

 [Maxima-bugs] [ maxima-Bugs-541030 ] integrate(sqrt(x+1/x-2),x,0,1) wrong From: SourceForge.net - 2006-02-27 18:01:41 ```Bugs item #541030, was opened at 2002-04-08 10:21 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&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: None Group: None >Status: Closed >Resolution: Fixed Priority: 9 Submitted By: David Billinghurst (billingd) Assigned to: Nobody/Anonymous (nobody) Summary: integrate(sqrt(x+1/x-2),x,0,1) wrong Initial Comment: The definite integral integrate(sqrt(x+1/x-2),x,0,1) => -4/3 with cvs maxima/gcl under windows. The answer should be 4/3 according to Michael Wester, "A Review of CAS Mathematical Capabilities", 15 April 1995. (Problem 84). It definitely should be positive. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2006-02-27 13:01 Message: Logged In: YES user_id=28849 Fixed as suggested. The indefinite integral returns the integral, but I think that's ok. Perhaps maxima should ask for the sign of x-1? ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2006-02-24 16:43 Message: Logged In: YES user_id=28849 I think the cause of this is in intform in sin.lisp. The very last cond clause sets \$radexpand to '\$all when doing maxima-substitute. This causes sqrt((x-1)^2) to be come (x-1), which is not right. If we set \$radexpand to '\$true, the definite integral is evaluated to 4/3. Hurray! But the indefinite integral returns the integral. Boo! ---------------------------------------------------------------------- Comment By: Pedro Fortuny Ayuso (pfortuny) Date: 2002-07-08 13:35 Message: Logged In: YES user_id=519681 FWIW, mupad 2.5 linux gives: int(sqrt(x+1/x-2),x); ----> int(sqrt(x+1/x-2),x); (i.e. not evaluated). while int(abs(x-1)/sqrt(x),x); -----> sign(x-1)(2*x^(3/2)/3-2*x^(1/2)) which, when evaluated at 1 gives: -4/3*sign(0). ... ... ... ---------------------------------------------------------------------- Comment By: Juan Hierro (buscaideas) Date: 2002-06-11 20:03 Message: Logged In: YES user_id=528795 I am not sure whether this should be a real bug or just a funny consequence of the indetermination in the sign of a square root. Looking at the comment by toy@..., one may realize that the result is correct provided that the sign of the square root in the integrand is shared with that of (x-1). This problems appears in much simpler funcions too. For instance, let us say one has f(x):=sqrt(x*x-2*x+1); Then, the sin algorithm performs the integration with sqrt always positive, while the risch algorithm works with sqrt sharing the sign of (x-1). factor(diff(integrate(f(x),x),x)); ==> sqrt(x*x-2*x+1) factor(diff(risch(f(x),x),x)); ==> (x-1) Is it wrong this behaviour? Should there be any way to specify which branch to employ when handling multivaluated functions? f(x) in this last situation may be either abs(x-1), or (x-1), or -abs(x-1), or (1-x). sin seems to work with abs(x-1) and risch with (x-1). In the same way, sqrt(x+1/x-2) is either abs(x-1)/sqrt(x) or (x-1)/sqrt(x) where both signs are admisible in sqrt(x). In this case, both sin and risch algorithms seem to work with (x-1)/sqrt(x). ---------------------------------------------------------------------- Comment By: David Billinghurst (billingd) Date: 2002-04-09 23:23 Message: Logged In: YES user_id=365569 toy@... (toy@...) wrote: I guess maxima gets this wrong because it says: (C1) integrate(sqrt(x+1/x-2),x); 3/2 2 x - 6 SQRT(x) (D1) ------------------ 3 which is only true if |x-1| is positive. For some reason it has assumed |x-1| is positive somewhere during integration. Yet another integration bug. Ray ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&group_id=4933 ```

 [Maxima-bugs] [ maxima-Bugs-541030 ] integrate(sqrt(x+1/x-2),x,0,1) wrong From: - 2002-07-08 17:35:51 ```Bugs item #541030, was opened at 2002-04-08 14:21 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 9 Submitted By: David Billinghurst (billingd) Assigned to: Nobody/Anonymous (nobody) Summary: integrate(sqrt(x+1/x-2),x,0,1) wrong Initial Comment: The definite integral integrate(sqrt(x+1/x-2),x,0,1) => -4/3 with cvs maxima/gcl under windows. The answer should be 4/3 according to Michael Wester, "A Review of CAS Mathematical Capabilities", 15 April 1995. (Problem 84). It definitely should be positive. ---------------------------------------------------------------------- Comment By: Pedro Fortuny Ayuso (pfortuny) Date: 2002-07-08 17:35 Message: Logged In: YES user_id=519681 FWIW, mupad 2.5 linux gives: int(sqrt(x+1/x-2),x); ----> int(sqrt(x+1/x-2),x); (i.e. not evaluated). while int(abs(x-1)/sqrt(x),x); -----> sign(x-1)(2*x^(3/2)/3-2*x^(1/2)) which, when evaluated at 1 gives: -4/3*sign(0). ... ... ... ---------------------------------------------------------------------- Comment By: Juan Hierro (buscaideas) Date: 2002-06-12 00:03 Message: Logged In: YES user_id=528795 I am not sure whether this should be a real bug or just a funny consequence of the indetermination in the sign of a square root. Looking at the comment by toy@..., one may realize that the result is correct provided that the sign of the square root in the integrand is shared with that of (x-1). This problems appears in much simpler funcions too. For instance, let us say one has f(x):=sqrt(x*x-2*x+1); Then, the sin algorithm performs the integration with sqrt always positive, while the risch algorithm works with sqrt sharing the sign of (x-1). factor(diff(integrate(f(x),x),x)); ==> sqrt(x*x-2*x+1) factor(diff(risch(f(x),x),x)); ==> (x-1) Is it wrong this behaviour? Should there be any way to specify which branch to employ when handling multivaluated functions? f(x) in this last situation may be either abs(x-1), or (x-1), or -abs(x-1), or (1-x). sin seems to work with abs(x-1) and risch with (x-1). In the same way, sqrt(x+1/x-2) is either abs(x-1)/sqrt(x) or (x-1)/sqrt(x) where both signs are admisible in sqrt(x). In this case, both sin and risch algorithms seem to work with (x-1)/sqrt(x). ---------------------------------------------------------------------- Comment By: David Billinghurst (billingd) Date: 2002-04-10 03:23 Message: Logged In: YES user_id=365569 toy@... (toy@...) wrote: I guess maxima gets this wrong because it says: (C1) integrate(sqrt(x+1/x-2),x); 3/2 2 x - 6 SQRT(x) (D1) ------------------ 3 which is only true if |x-1| is positive. For some reason it has assumed |x-1| is positive somewhere during integration. Yet another integration bug. Ray ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-541030 ] integrate(sqrt(x+1/x-2),x,0,1) wrong From: SourceForge.net - 2006-02-24 21:43:36 ```Bugs item #541030, was opened at 2002-04-08 10:21 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&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: None Group: None Status: Open Resolution: None Priority: 9 Submitted By: David Billinghurst (billingd) Assigned to: Nobody/Anonymous (nobody) Summary: integrate(sqrt(x+1/x-2),x,0,1) wrong Initial Comment: The definite integral integrate(sqrt(x+1/x-2),x,0,1) => -4/3 with cvs maxima/gcl under windows. The answer should be 4/3 according to Michael Wester, "A Review of CAS Mathematical Capabilities", 15 April 1995. (Problem 84). It definitely should be positive. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2006-02-24 16:43 Message: Logged In: YES user_id=28849 I think the cause of this is in intform in sin.lisp. The very last cond clause sets \$radexpand to '\$all when doing maxima-substitute. This causes sqrt((x-1)^2) to be come (x-1), which is not right. If we set \$radexpand to '\$true, the definite integral is evaluated to 4/3. Hurray! But the indefinite integral returns the integral. Boo! ---------------------------------------------------------------------- Comment By: Pedro Fortuny Ayuso (pfortuny) Date: 2002-07-08 13:35 Message: Logged In: YES user_id=519681 FWIW, mupad 2.5 linux gives: int(sqrt(x+1/x-2),x); ----> int(sqrt(x+1/x-2),x); (i.e. not evaluated). while int(abs(x-1)/sqrt(x),x); -----> sign(x-1)(2*x^(3/2)/3-2*x^(1/2)) which, when evaluated at 1 gives: -4/3*sign(0). ... ... ... ---------------------------------------------------------------------- Comment By: Juan Hierro (buscaideas) Date: 2002-06-11 20:03 Message: Logged In: YES user_id=528795 I am not sure whether this should be a real bug or just a funny consequence of the indetermination in the sign of a square root. Looking at the comment by toy@..., one may realize that the result is correct provided that the sign of the square root in the integrand is shared with that of (x-1). This problems appears in much simpler funcions too. For instance, let us say one has f(x):=sqrt(x*x-2*x+1); Then, the sin algorithm performs the integration with sqrt always positive, while the risch algorithm works with sqrt sharing the sign of (x-1). factor(diff(integrate(f(x),x),x)); ==> sqrt(x*x-2*x+1) factor(diff(risch(f(x),x),x)); ==> (x-1) Is it wrong this behaviour? Should there be any way to specify which branch to employ when handling multivaluated functions? f(x) in this last situation may be either abs(x-1), or (x-1), or -abs(x-1), or (1-x). sin seems to work with abs(x-1) and risch with (x-1). In the same way, sqrt(x+1/x-2) is either abs(x-1)/sqrt(x) or (x-1)/sqrt(x) where both signs are admisible in sqrt(x). In this case, both sin and risch algorithms seem to work with (x-1)/sqrt(x). ---------------------------------------------------------------------- Comment By: David Billinghurst (billingd) Date: 2002-04-09 23:23 Message: Logged In: YES user_id=365569 toy@... (toy@...) wrote: I guess maxima gets this wrong because it says: (C1) integrate(sqrt(x+1/x-2),x); 3/2 2 x - 6 SQRT(x) (D1) ------------------ 3 which is only true if |x-1| is positive. For some reason it has assumed |x-1| is positive somewhere during integration. Yet another integration bug. Ray ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-541030 ] integrate(sqrt(x+1/x-2),x,0,1) wrong From: SourceForge.net - 2006-02-27 18:01:41 ```Bugs item #541030, was opened at 2002-04-08 10:21 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&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: None Group: None >Status: Closed >Resolution: Fixed Priority: 9 Submitted By: David Billinghurst (billingd) Assigned to: Nobody/Anonymous (nobody) Summary: integrate(sqrt(x+1/x-2),x,0,1) wrong Initial Comment: The definite integral integrate(sqrt(x+1/x-2),x,0,1) => -4/3 with cvs maxima/gcl under windows. The answer should be 4/3 according to Michael Wester, "A Review of CAS Mathematical Capabilities", 15 April 1995. (Problem 84). It definitely should be positive. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2006-02-27 13:01 Message: Logged In: YES user_id=28849 Fixed as suggested. The indefinite integral returns the integral, but I think that's ok. Perhaps maxima should ask for the sign of x-1? ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2006-02-24 16:43 Message: Logged In: YES user_id=28849 I think the cause of this is in intform in sin.lisp. The very last cond clause sets \$radexpand to '\$all when doing maxima-substitute. This causes sqrt((x-1)^2) to be come (x-1), which is not right. If we set \$radexpand to '\$true, the definite integral is evaluated to 4/3. Hurray! But the indefinite integral returns the integral. Boo! ---------------------------------------------------------------------- Comment By: Pedro Fortuny Ayuso (pfortuny) Date: 2002-07-08 13:35 Message: Logged In: YES user_id=519681 FWIW, mupad 2.5 linux gives: int(sqrt(x+1/x-2),x); ----> int(sqrt(x+1/x-2),x); (i.e. not evaluated). while int(abs(x-1)/sqrt(x),x); -----> sign(x-1)(2*x^(3/2)/3-2*x^(1/2)) which, when evaluated at 1 gives: -4/3*sign(0). ... ... ... ---------------------------------------------------------------------- Comment By: Juan Hierro (buscaideas) Date: 2002-06-11 20:03 Message: Logged In: YES user_id=528795 I am not sure whether this should be a real bug or just a funny consequence of the indetermination in the sign of a square root. Looking at the comment by toy@..., one may realize that the result is correct provided that the sign of the square root in the integrand is shared with that of (x-1). This problems appears in much simpler funcions too. For instance, let us say one has f(x):=sqrt(x*x-2*x+1); Then, the sin algorithm performs the integration with sqrt always positive, while the risch algorithm works with sqrt sharing the sign of (x-1). factor(diff(integrate(f(x),x),x)); ==> sqrt(x*x-2*x+1) factor(diff(risch(f(x),x),x)); ==> (x-1) Is it wrong this behaviour? Should there be any way to specify which branch to employ when handling multivaluated functions? f(x) in this last situation may be either abs(x-1), or (x-1), or -abs(x-1), or (1-x). sin seems to work with abs(x-1) and risch with (x-1). In the same way, sqrt(x+1/x-2) is either abs(x-1)/sqrt(x) or (x-1)/sqrt(x) where both signs are admisible in sqrt(x). In this case, both sin and risch algorithms seem to work with (x-1)/sqrt(x). ---------------------------------------------------------------------- Comment By: David Billinghurst (billingd) Date: 2002-04-09 23:23 Message: Logged In: YES user_id=365569 toy@... (toy@...) wrote: I guess maxima gets this wrong because it says: (C1) integrate(sqrt(x+1/x-2),x); 3/2 2 x - 6 SQRT(x) (D1) ------------------ 3 which is only true if |x-1| is positive. For some reason it has assumed |x-1| is positive somewhere during integration. Yet another integration bug. Ray ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=541030&group_id=4933 ```