{"id":1300,"date":"2015-12-21T12:00:36","date_gmt":"2015-12-21T17:00:36","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=1300"},"modified":"2015-12-18T00:41:40","modified_gmt":"2015-12-18T05:41:40","slug":"a-historic-cubic","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2015\/12\/21\/a-historic-cubic\/","title":{"rendered":"A Historic Cubic"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>The cubic polynomial $x^3 - 2x - 5$ has a unique place in the history of numerical methods.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#1f355aec-eeb0-4b6d-8115-1e5e69a30334\">Whittaker and Robinson<\/a><\/li><li><a href=\"#52ef202f-e062-4579-b1d4-2a0aa2e99a15\">The footnote<\/a><\/li><li><a href=\"#7890d17b-c220-4bcc-9abe-1c6cd7bbe35d\">De Morgan<\/a><\/li><li><a href=\"#25fad15e-ce8c-410a-8702-c6c7d9f7453a\">Wicket Gate<\/a><\/li><li><a href=\"#8538bd81-3b2a-4fac-9439-0bff19b7246d\">Cardano's formula<\/a><\/li><li><a href=\"#710de82f-6ad7-4a45-9967-172f7809703c\">ezplot<\/a><\/li><li><a href=\"#81fc6c6c-96c6-473d-a34c-05ff6ceeb572\">Seeking Salvation<\/a><\/li><li><a href=\"#deb7795c-dcf5-496b-95ba-941bc825940f\">References<\/a><\/li><\/ul><\/div><h4>Whittaker and Robinson<a name=\"1f355aec-eeb0-4b6d-8115-1e5e69a30334\"><\/a><\/h4><p><i>The Calculus of Observations, A Treatise on Numerical Mathematics<\/i>, by E. T. Whittaker and G. Robinson, is a classic text on numerical analysis that was first published in London in 1924.  A scan of the complete book, made by the Million Books Project, is available online at the link referenced below.  (The copy of the book that was scanned is actually from India, the library of Osmania University in Hyderabad.)<\/p><p>The section on the Newton-Raphson method uses<\/p><p>$$ x^3-2x-5 $$<\/p><p>as the first example.  A footnote on the example caught my eye years ago and I've always remembered it.<\/p><h4>The footnote<a name=\"52ef202f-e062-4579-b1d4-2a0aa2e99a15\"><\/a><\/h4><p>\"The reason I call $x^3-2x-5=0$ a celebrated equation is because it was the one on which Wallis chanced to exhibit Newton's method when he first published it, in consequence of which every numerical solver has felt bound in duty to make it one of his examples. Invent a numerical method, neglect to show how it works on this equation, and you are a pilgrim who does not come in at the little wicket (<i>vide<\/i> J. Bunyan).\"<\/p><h4>De Morgan<a name=\"7890d17b-c220-4bcc-9abe-1c6cd7bbe35d\"><\/a><\/h4><p>Augustus de Morgan was an eminent 19-th century British mathematician. He formulated De Morgan's laws of boolean algebra and propositionai logic, and was known as a witty correspondent.  The footnote in Whittaker and Robinson is a quotation from one of many letters that de Morgan wrote to his friend and former teacher at Trinity College, Cambridge, William Whewell.  The letter was written January 20th, 1861, and is included in a memoir of de Morgan published by his wife, Sophia Elizabeth, in 1882. A scan of the memoir, made by the Internet Archives project, is also available online.  (The copy of the book came from the library at the University of California, Santa Cruz.)<\/p><h4>Wicket Gate<a name=\"25fad15e-ce8c-410a-8702-c6c7d9f7453a\"><\/a><\/h4><p>I've never seen or heard the phrase \"a pilgrim who does not come in at the little wicket\" anyplace else.  If any reader of this blog can tell us more about it, please contribute a comment.<\/p><p>A wicket gate is a small gate, often part of a larger one. The Pilgrim referred to is the protagonist Christian in <i>Pilgrim's Progress<\/i>, a 17-th century allegory by John Bunyan.  Many of us remember <i>Pilgrim's Progress<\/i> from our studies of English literature. Christian entering the Wicket Gate is analogous to Everyman obtaining Salvation.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/pilgrims_progress_2.jpg\" alt=\"\"> <\/p><p><i>Christian enters the Wicket Gate in Pilgrim's Progress<\/i><\/p><p><a href=\"http:\/\/en.wikipedia.org\/wiki\/The_Pilgrim's_Progress\">http:\/\/en.wikipedia.org\/wiki\/The_Pilgrim's_Progress<\/a><\/p><h4>Cardano's formula<a name=\"8538bd81-3b2a-4fac-9439-0bff19b7246d\"><\/a><\/h4><p>Most of us also remember the formula for solving a quadratic equation. There is a corresponding formula for solving cubics, but I bet that few of my readers can spontaneously recite it.<\/p><p>Gerolamo Cardano and Niccolo Fontana Tartaglia were 16-th century Italian polymaths who had what was at first a friendly competition and later a famous feud about how to solve cubic equations.  They probably both learned how to solve them from the work of another Italian, Scipione del Ferro.<\/p><p>What we now know as Cardano's formula applies to a <i>depressed<\/i> cubic where the quadratic term has been removed by a simple change of variable. A depressed cubic equation is<\/p><p>$$ x^3 = px + q $$<\/p><p>Cardano's formula for the solution is<\/p><p>$$ x = \\sqrt[3]{\\frac{q}{2}+\\sqrt{\\frac{q^2}{4}-\\frac{p^3}{27}}}\r\n     + \\sqrt[3]{\\frac{q}{2}-\\sqrt{\\frac{q^2}{4}-\\frac{p^3}{27}}} $$<\/p><p>My favorite cubic is already depressed, so<\/p><pre class=\"codeinput\">   p = 2;\r\n   q = 5;\r\n   s = sqrt(q^2\/4 - p^3\/27);\r\n   x0 = (q\/2 + s)^(1\/3) + (q\/2 - s)^(1\/3)\r\n<\/pre><pre class=\"codeoutput\">x0 =\r\n   2.094551481542327\r\n<\/pre><h4>ezplot<a name=\"710de82f-6ad7-4a45-9967-172f7809703c\"><\/a><\/h4><p>Here is the interesting portion of the graph of our cubic with the axes through the solution obtained from Cardano's formula.<\/p><pre class=\"codeinput\">   f = @(x) x.^3-2*x-5\r\n   ezplot(f,[-1.5 3])\r\n   axis([-1.5 3 -8 8])\r\n   line([x0 x0],[0 0],<span class=\"string\">'marker'<\/span>,<span class=\"string\">'o'<\/span>)\r\n   line([x0 x0],[-8 8],<span class=\"string\">'color'<\/span>,<span class=\"string\">'k'<\/span>)\r\n   line([-1.5 3],[0 0],<span class=\"string\">'color'<\/span>,<span class=\"string\">'k'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">f = \r\n    @(x)x.^3-2*x-5\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog_01.png\" alt=\"\"> <h4>Seeking Salvation<a name=\"81fc6c6c-96c6-473d-a34c-05ff6ceeb572\"><\/a><\/h4><p>Cardano's formula applies only to cubics.  So in my next post I plan to try out several different algorithms that apply to more general equations and confirm that their MATLAB implementations come in at de Morgan's little wicket.<\/p><h4>References<a name=\"deb7795c-dcf5-496b-95ba-941bc825940f\"><\/a><\/h4><p>E. T. Whittaker and G. Robinson, <i>The Calculus of Observations, A Treatise on Numerical Mathematics<\/i>. Blackie and Son Limited, London, 1924, 394 pp. <a href=\"http:\/\/archive.org\/details\/calculusofobserv031400mbp\">&lt;http:\/\/archive.org\/details\/calculusofobserv031400mbp<\/a>&gt;<\/p><p>Sophia Elizabeth De Morgan, <i>Memoir of August De Morgan<\/i>. Longmans, Green, and Co., London, 1882, 468 pp. <a href=\"http:\/\/archive.org\/details\/memoirofaugustus00demorich\">&lt;http:\/\/archive.org\/details\/memoirofaugustus00demorich<\/a>&gt;<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_096a4e140caf46c88555b96c5546eccf() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='096a4e140caf46c88555b96c5546eccf ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 096a4e140caf46c88555b96c5546eccf';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2015 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_096a4e140caf46c88555b96c5546eccf()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015a<br><\/p><\/div><!--\r\n096a4e140caf46c88555b96c5546eccf ##### SOURCE BEGIN #####\r\n%% A Historic Cubic\r\n% The cubic polynomial $x^3 - 2x - 5$ has a unique place in the history\r\n% of numerical methods.\r\n\r\n%% Whittaker and Robinson\r\n% _The Calculus of Observations, A Treatise on Numerical Mathematics_,\r\n% by E. T. Whittaker and G. Robinson, is a classic text on numerical analysis\r\n% that was first published in London in 1924.  A scan of the complete book,\r\n% made by the Million Books Project, is available online at the link\r\n% referenced below.  (The copy of the book that was scanned is actually from\r\n% India, the library of Osmania University in Hyderabad.)\r\n\r\n%%\r\n% The section on the Newton-Raphson method uses \r\n%\r\n% $$ x^3-2x-5 $$\r\n%\r\n% as the first example.  A footnote on the example caught my eye years ago\r\n% and I've always remembered it.\r\n\r\n%% The footnote\r\n% \"The reason I call $x^3-2x-5=0$ a celebrated equation is because it was the\r\n% one on which Wallis chanced to exhibit Newton's method when he first published\r\n% it, in consequence of which every numerical solver has felt bound in duty to\r\n% make it one of his examples. Invent a numerical method, neglect to show how\r\n% it works on this equation, and you are a pilgrim who does not come in at the\r\n% little wicket (_vide_ J. Bunyan).\"\r\n\r\n%% De Morgan \r\n% Augustus de Morgan was an eminent 19-th century British mathematician.\r\n% He formulated De Morgan's laws of boolean algebra and propositionai logic,\r\n% and was known as a witty correspondent.  The footnote in Whittaker and\r\n% Robinson is a quotation from one of many letters that de Morgan wrote to\r\n% his friend and former teacher at Trinity College, Cambridge, William\r\n% Whewell.  The letter was written January 20th, 1861, and is included in a\r\n% memoir of de Morgan published by his wife, Sophia Elizabeth, in 1882.\r\n% A scan of the memoir, made by the Internet Archives project, is also\r\n% available online.  (The copy of the book came from the library at the\r\n% University of California, Santa Cruz.)\r\n\r\n%% Wicket Gate\r\n% I've never seen or heard the phrase \"a pilgrim who does not come in at the\r\n% little wicket\" anyplace else.  If any reader of this blog can tell us more\r\n% about it, please contribute a comment. \r\n\r\n%%\r\n% A wicket gate is a small gate, often part of a larger one.\r\n% The Pilgrim referred to is the protagonist Christian in _Pilgrim's\r\n% Progress_, a 17-th century allegory by John Bunyan.  Many of us remember\r\n% _Pilgrim's Progress_ from our studies of English literature. \r\n% Christian entering the Wicket Gate is analogous to Everyman obtaining\r\n% Salvation.\r\n%\r\n% <<pilgrims_progress_2.jpg>>\r\n%\r\n% _Christian enters the Wicket Gate in Pilgrim's Progress_\r\n%\r\n% http:\/\/en.wikipedia.org\/wiki\/The_Pilgrim's_Progress\r\n%\r\n\r\n%% Cardano's formula\r\n% Most of us also remember the formula for solving a quadratic equation.\r\n% There is a corresponding formula for solving cubics, but I bet that few\r\n% of my readers can spontaneously recite it.\r\n\r\n%%\r\n% Gerolamo Cardano and Niccolo Fontana Tartaglia were 16-th century Italian\r\n% polymaths who had what was at first a friendly competition and later a\r\n% famous feud about how to solve cubic equations.  They probably both\r\n% learned how to solve them from the work of another Italian, Scipione del\r\n% Ferro.\r\n\r\n%%\r\n% What we now know as Cardano's formula applies to a _depressed_ cubic\r\n% where the quadratic term has been removed by a simple change of variable.\r\n% A depressed cubic equation is\r\n%\r\n% $$ x^3 = px + q $$\r\n%\r\n% Cardano's formula for the solution is\r\n%\r\n% $$ x = \\sqrt[3]{\\frac{q}{2}+\\sqrt{\\frac{q^2}{4}-\\frac{p^3}{27}}}\r\n%      + \\sqrt[3]{\\frac{q}{2}-\\sqrt{\\frac{q^2}{4}-\\frac{p^3}{27}}} $$\r\n\r\n%%\r\n% My favorite cubic is already depressed, so\r\n\r\n   p = 2;\r\n   q = 5;\r\n   s = sqrt(q^2\/4 - p^3\/27);\r\n   x0 = (q\/2 + s)^(1\/3) + (q\/2 - s)^(1\/3)\r\n\r\n%% ezplot\r\n% Here is the interesting portion of the graph of our cubic with\r\n% the axes through the solution obtained from Cardano's formula.\r\n\r\n   f = @(x) x.^3-2*x-5\r\n   ezplot(f,[-1.5 3])\r\n   axis([-1.5 3 -8 8])\r\n   line([x0 x0],[0 0],'marker','o')\r\n   line([x0 x0],[-8 8],'color','k')\r\n   line([-1.5 3],[0 0],'color','k')\r\n\r\n%% Seeking Salvation\r\n% Cardano's formula applies only to cubics.  So in my next post I plan to\r\n% try out several different algorithms that apply to more general equations\r\n% and confirm that their MATLAB implementations come in at de Morgan's\r\n% little wicket.\r\n\r\n%% References\r\n% E. T. Whittaker and G. Robinson,\r\n% _The Calculus of Observations, A Treatise on Numerical Mathematics_.\r\n% Blackie and Son Limited, London, 1924, 394 pp.\r\n% <http:\/\/archive.org\/details\/calculusofobserv031400mbp\r\n% http:\/\/archive.org\/details\/calculusofobserv031400mbp> \r\n%\r\n% Sophia Elizabeth De Morgan, _Memoir of August De Morgan_.\r\n% Longmans, Green, and Co., London, 1882, 468 pp.\r\n% <http:\/\/archive.org\/details\/memoirofaugustus00demorich\r\n% http:\/\/archive.org\/details\/memoirofaugustus00demorich>\r\n\r\n##### SOURCE END ##### 096a4e140caf46c88555b96c5546eccf\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/pilgrims_progress_2.jpg\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>The cubic polynomial $x^3 - 2x - 5$ has a unique place in the history of numerical methods.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2015\/12\/21\/a-historic-cubic\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,16,8],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/1300"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=1300"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/1300\/revisions"}],"predecessor-version":[{"id":1301,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/1300\/revisions\/1301"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=1300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=1300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=1300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}