{"id":1077,"date":"2012-08-26T19:48:43","date_gmt":"2012-08-26T17:48:43","guid":{"rendered":"http:\/\/cerezo.name\/blog\/?p=1077"},"modified":"2024-10-14T13:57:05","modified_gmt":"2024-10-14T11:57:05","slug":"to-err-is-cas-possible","status":"publish","type":"post","link":"https:\/\/cerezo.name\/blog\/2012\/08\/26\/to-err-is-cas-possible\/","title":{"rendered":"To Err is CAS-possible"},"content":{"rendered":"<p style=\"text-align: justify;\">I was aware that there are too many errors on any <span class=\"caps\">CAS<\/span> to be listed on the margin of their accompanying documentation. But finding the culprit after hours of debugging, a very simple bug but with a very high impact since other complex calculations are being based on its proper calculation, is a disturbing experience. It turns out that, in Mathematica,<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: courier new,courier;\"><strong>In[1]:= badIntegration <\/strong><strong>= <\/strong><strong>Integrate<\/strong><strong>[<\/strong><strong>1 <\/strong><strong>\/ (<\/strong><strong>2 <\/strong><strong>+ <\/strong><strong>Cos<\/strong><strong>[<\/strong><strong>x<\/strong><strong>])<\/strong><strong>, <\/strong><strong>{<\/strong><strong>x, 0, y}, Assumptions <\/strong><strong>-&gt; <\/strong><strong>y <\/strong><strong>&gt; Pi]<\/strong><\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: courier new,courier;\"><strong>Out[1]:= 2(Pi+ ArcTan[Tan[y\/2]\/ Sqrt(3))\/Sqrt(3)<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">is symbolically evaluated as a discontinuous function, even if it must clearly be continuous, since the integrand is everywhere continuous, finite and positive. But the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Weierstrass_substitution\" target=\"_blank\" rel=\"noopener\">Weierstrass substitution method<\/a> used internally when symbolically calculating integrals of inverse trigonometric functions sometimes produces discontinuities. Go figure.<\/p>\n<p style=\"text-align: justify;\">Lesson learned: as a safety measure, always use multiple <span class=\"caps\">CAS<\/span> programs (<span class=\"caps\">SAGE<\/span>, Maple, \u2026) &nbsp;to compare solutions when getting strange results.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was aware that there are too many errors on any <span class=\"caps\">CAS<\/span> to be listed on the margin of their accompanying documentation. But finding the culprit after hours of debugging, a very simple bug but with a very high impact since other complex calculations are being based on its proper calculation, is a disturbing experience.&nbsp;[\u2026]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"ngg_post_thumbnail":0},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts\/1077"}],"collection":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/comments?post=1077"}],"version-history":[{"count":2,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts\/1077\/revisions"}],"predecessor-version":[{"id":1589,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts\/1077\/revisions\/1589"}],"wp:attachment":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/media?parent=1077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/categories?post=1077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/tags?post=1077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}