## maxima-bugs

 [Maxima-bugs] [ maxima-Bugs-3547652 ] Differentiation of a function yields wrong answer From: SourceForge.net - 2012-07-23 15:48:31 ```Bugs item #3547652, was opened at 2012-07-23 08:48 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&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 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Differentiation of a function yields wrong answer Initial Comment: build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") The differentiation gives erroneous answer kr2(x):=(sin(%pi*x/2)*sin(%pi*x/3))^2; kr2(x):=(sin((%pi*x)/2)*sin((%pi*x)/3))^2 diff(kr2(x),x,1); (2*%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + %pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2) This is clearly wrong. The right answer is: (%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + (%pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2))/2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-3547652 ] Differentiation of a function yields wrong answer From: SourceForge.net - 2012-07-23 16:11:34 ```Bugs item #3547652, was opened at 2012-07-23 08:48 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&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 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Differentiation of a function yields wrong answer Initial Comment: build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") The differentiation gives erroneous answer kr2(x):=(sin(%pi*x/2)*sin(%pi*x/3))^2; kr2(x):=(sin((%pi*x)/2)*sin((%pi*x)/3))^2 diff(kr2(x),x,1); (2*%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + %pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2) This is clearly wrong. The right answer is: (%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + (%pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2))/2 ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2012-07-23 09:11 Message: Can you explain why you think maxima is wrong? From your example, kr2(x) = kr(x)^2 where kr(x) = sin(%pi*x/2)*sin(%pi*x/3). So diff(kr2(x),x) = 2*kr(x)*diff(kr(x),x) which gives maxima's answer, not yours. In fact, maxima's result is exactly 2 times your proposed correct answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-3547652 ] Differentiation of a function yields wrong answer From: SourceForge.net - 2012-07-31 17:04:39 ```Bugs item #3547652, was opened at 2012-07-23 08:48 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&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 Group: None >Status: Pending >Resolution: Invalid Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Differentiation of a function yields wrong answer Initial Comment: build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") The differentiation gives erroneous answer kr2(x):=(sin(%pi*x/2)*sin(%pi*x/3))^2; kr2(x):=(sin((%pi*x)/2)*sin((%pi*x)/3))^2 diff(kr2(x),x,1); (2*%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + %pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2) This is clearly wrong. The right answer is: (%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + (%pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2))/2 ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2012-07-31 10:04 Message: Marking as pending/invalid. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2012-07-23 09:11 Message: Can you explain why you think maxima is wrong? From your example, kr2(x) = kr(x)^2 where kr(x) = sin(%pi*x/2)*sin(%pi*x/3). So diff(kr2(x),x) = 2*kr(x)*diff(kr(x),x) which gives maxima's answer, not yours. In fact, maxima's result is exactly 2 times your proposed correct answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-3547652 ] Differentiation of a function yields wrong answer From: SourceForge.net - 2012-08-13 17:57:41 ```Bugs item #3547652, was opened at 2012-07-23 08:48 Message generated for change (Settings changed) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&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 Group: None >Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Differentiation of a function yields wrong answer Initial Comment: build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") The differentiation gives erroneous answer kr2(x):=(sin(%pi*x/2)*sin(%pi*x/3))^2; kr2(x):=(sin((%pi*x)/2)*sin((%pi*x)/3))^2 diff(kr2(x),x,1); (2*%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + %pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2) This is clearly wrong. The right answer is: (%pi*cos((%pi*x)/3)*sin((%pi*x)/3)*sin((%pi*x)/2)^2)/3 + (%pi*sin((%pi*x)/3)^2*cos((%pi*x)/2)*sin((%pi*x)/2))/2 ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2012-07-31 10:04 Message: Marking as pending/invalid. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2012-07-23 09:11 Message: Can you explain why you think maxima is wrong? From your example, kr2(x) = kr(x)^2 where kr(x) = sin(%pi*x/2)*sin(%pi*x/3). So diff(kr2(x),x) = 2*kr(x)*diff(kr(x),x) which gives maxima's answer, not yours. In fact, maxima's result is exactly 2 times your proposed correct answer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547652&group_id=4933 ```