[{"id":247547,"date":"2026-08-05T13:26:25","date_gmt":"2026-08-05T18:26:25","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247547"},"modified":"2026-08-05T13:26:25","modified_gmt":"2026-08-05T18:26:25","slug":"math-log","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/math-log\/","title":{"rendered":"The code that didn&#8217;t break"},"content":{"rendered":"<p>Last week I wrote a <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/\">post<\/a> on hiding cryptographic keys in decks of cards. I wrote some code for that post that shouldn&#8217;t work, but before fixing I noticed that it in fact did work.<\/p>\n<p>The code computes logarithms for integers larger than the largest representable float. For example, the largest float is on the order of 10<sup>308<\/sup>, and yet the following code works.<\/p>\n<pre>&gt;&gt;&gt; import math\r\n&gt;&gt;&gt; math.log10(10**400)\r\n400.0\r\n<\/pre>\n<p>The <code>log<\/code>, <code>log2<\/code>, and <code>log10<\/code> functions have some code inside that handles large integers specially. It doesn&#8217;t simply convert the integers to floats before taking the logarithm. If it did, it would overflow.<\/p>\n<p>While playing around with this I also noticed that you can define floats larger than the largest float without warnings.<\/p>\n<pre>&gt;&gt;&gt; math.log(1e308)\r\n709.1962086421661\r\n&gt;&gt;&gt; math.log(1e309)\r\ninf\r\n<\/pre>\n<p>This isn&#8217;t a feature of <code>math.log<\/code> but of how Python handles scientific notation. The expression <code>1e308<\/code> is the floating point representation of 10<sup>308<\/sup>. It is a float, not an int.<\/p>\n<pre>&gt;&gt;&gt; type(1e308)\r\n&lt;class 'float'&gt;\r\n<\/pre>\n<p>The expression <code>1e309<\/code> is also a float. But since it&#8217;s larger than is possible for a float, Python interprets it as <code>inf<\/code>. The code<\/p>\n<pre>math.log(1e309)<\/pre>\n<p>returns <code>inf<\/code> based on the reasoning that log(\u221e) = \u221e.<\/p>\n<p>That explains the following behavior:<\/p>\n<pre>&gt;&gt;&gt; 1e309 == 1e310\r\nTrue\r\n<\/pre>\n<p>The expressions <code>1e309<\/code> and <code>1e310<\/code> are equal because both are alternate ways of writing <code>inf<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I wrote a post on hiding cryptographic keys in decks of cards. I wrote some code for that post that shouldn&#8217;t work, but before fixing I noticed that it in fact did work. The code computes logarithms for integers larger than the largest representable float. For example, the largest float is on the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[169],"class_list":["post-247547","post","type-post","status-publish","format-standard","hentry","category-math","tag-python"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"A couple oddities in math with very large numbers in Python\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"python\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/math-log\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"The code that didn\u2019t break\" \/>\n\t\t<meta property=\"og:description\" content=\"A couple oddities in math with very large numbers in Python\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/math-log\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-05T18:26:25+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-05T18:26:25+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"The code that didn\u2019t break\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A couple oddities in math with very large numbers in Python\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"The code that didn\u2019t break","description":"A couple oddities in math with very large numbers in Python","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/math-log\/","robots":"max-image-preview:large","keywords":"python","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"The code that didn\u2019t break","og:description":"A couple oddities in math with very large numbers in Python","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/math-log\/","article:published_time":"2026-08-05T18:26:25+00:00","article:modified_time":"2026-08-05T18:26:25+00:00","twitter:card":"summary","twitter:title":"The code that didn\u2019t break","twitter:description":"A couple oddities in math with very large numbers in Python","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247547","title":null,"description":"A couple oddities in math with very large numbers in Python","keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-05 17:47:04","updated":"2026-08-05 18:26:25","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tThe code that didn\u2019t break\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"The code that didn&#8217;t break","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/math-log\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247547"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247547\/revisions"}],"predecessor-version":[{"id":247549,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247547\/revisions\/247549"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247540,"date":"2026-08-05T09:49:35","date_gmt":"2026-08-05T14:49:35","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247540"},"modified":"2026-08-05T10:51:33","modified_gmt":"2026-08-05T15:51:33","slug":"enumerating-trees-and-circles","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/enumerating-trees-and-circles\/","title":{"rendered":"Enumerating trees and circles"},"content":{"rendered":"<p>A few days ago I wrote a post on <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\">counting rooted trees<\/a>. That post looked at the sequence <em>c<\/em>(<em>n<\/em>) which counts the number of rooted trees with <em>n<\/em> nodes. Here one node is distinguished as the root, but the nodes below the root are not distinguished from each other; all that matters is how the nodes are connected.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/rooted_trees_order_1_to_4.svg\" width=\"680\" height=\"600\" \/><\/p>\n<p>The number of rooted trees with <em>n<\/em> nodes is the same as the number of ways to configure <em>n<\/em> \u2212 1 non-overlapping circles. Not only are the counts the same, there is a natural correspondence between the trees and the circles. It&#8217;s not obvious that there should be such a correspondence, with the right notation the correspondence is sort of a pun.<\/p>\n<p>The standard way to represent unlabeled trees is as a <a href=\"https:\/\/www.johndcook.com\/blog\/2022\/10\/26\/multisets\/\">multiset<\/a> of their children. We use a multiset, not a set, because some elements will be repeated. We represent a leaf as a pair of parentheses: <code>()<\/code>.<\/p>\n<p>There is only one rooted tree with one node: <code>()<\/code>.<\/p>\n<p>There is only one rooted tree with one two nodes: <code>(())<\/code>. Here the outer parentheses represent the root node and the inner parentheses represent its child.<\/p>\n<p>There are two rooted trees with three nodes, and we can represent them as <code>((()))<\/code> and <code>((),())<\/code>. The first is the straight line tree: a node that has a single child node that has a single child node. The second is a node that branches to two nodes. (Here&#8217;s where we need multisets.)<\/p>\n<p>The four rooted trees with four nodes can be represented as <code>(((())))<\/code>, <code>((((),()))<\/code>, <code>((),(()))<\/code>, and <code>((),(),(),())<\/code>.<\/p>\n<p>Here are the nine rooted trees with five nodes:<\/p>\n<pre>((((()))))\r\n((((),())))\r\n(((),(())))\r\n(((),(),()))\r\n((()),(()))\r\n((),((())))\r\n((),((),()))\r\n((),(),(()))\r\n((),(),(),())\r\n<\/pre>\n<p>The correspondence with non-overlapping circles removes the outer parentheses then joins the rest to form circles, with nested parentheses corresponding to concentric circles. A more geometric way to see the correspondence is to start at the bottom of the tree, replace leaves with circles, then work your way up circling connected components.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/nonoverlapping_circles.png\" width=\"362\" height=\"896\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few days ago I wrote a post on counting rooted trees. That post looked at the sequence c(n) which counts the number of rooted trees with n nodes. Here one node is distinguished as the root, but the nodes below the root are not distinguished from each other; all that matters is how the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-247540","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"There&#039;s a one-to-one correspondence between rooted trees and non-overlapping circles\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/enumerating-trees-and-circles\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Enumerating trees and circles\" \/>\n\t\t<meta property=\"og:description\" content=\"There&#039;s a one-to-one correspondence between rooted trees and non-overlapping circles\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/enumerating-trees-and-circles\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-05T14:49:35+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-05T15:51:33+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Enumerating trees and circles\" \/>\n\t\t<meta name=\"twitter:description\" content=\"There&#039;s a one-to-one correspondence between rooted trees and non-overlapping circles\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Enumerating trees and circles","description":"There's a one-to-one correspondence between rooted trees and non-overlapping circles","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/enumerating-trees-and-circles\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Enumerating trees and circles","og:description":"There's a one-to-one correspondence between rooted trees and non-overlapping circles","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/enumerating-trees-and-circles\/","article:published_time":"2026-08-05T14:49:35+00:00","article:modified_time":"2026-08-05T15:51:33+00:00","twitter:card":"summary","twitter:title":"Enumerating trees and circles","twitter:description":"There's a one-to-one correspondence between rooted trees and non-overlapping circles","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247540","title":null,"description":"There's a one-to-one correspondence between rooted trees and non-overlapping circles","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-05 12:48:37","updated":"2026-08-05 17:40:38","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/uncategorized\/\" title=\"Uncategorized\">Uncategorized<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tEnumerating trees and circles\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Uncategorized","link":"https:\/\/www.johndcook.com\/blog\/category\/uncategorized\/"},{"label":"Enumerating trees and circles","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/05\/enumerating-trees-and-circles\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247540"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247540\/revisions"}],"predecessor-version":[{"id":247544,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247540\/revisions\/247544"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247536,"date":"2026-08-04T08:18:58","date_gmt":"2026-08-04T13:18:58","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247536"},"modified":"2026-08-04T20:20:01","modified_gmt":"2026-08-05T01:20:01","slug":"metallic-alchemy","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/","title":{"rendered":"Mathematical alchemy"},"content":{"rendered":"<p>After writing the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/\">previous post<\/a> about metallic ratios, I thought about the analogy to alchemy and the attempt to make precious metals out of base metals.<\/p>\n<p>When can you make one metallic ratio out of another? Can you make the golden ratio out of the lead ratio?<\/p>\n<p>Before we can make gold out of lead, we have to say what lead is.<\/p>\n<h2>Defining metallic ratios<\/h2>\n<p>The metallic ratios\u00a0<em>M<\/em>(<em>n<\/em>) can be defined several ways. The most interesting definition is the number whose continued fraction representation contains all <em>n<\/em>s. A more prosaic but more convenient definition is the larger number that equals its reciprocal plus <em>n<\/em>, which can be found using the quadratic formula.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/metallic_ratio_def.svg\" alt=\"M(n) = n + \\cfrac{1}{n+\\cfrac{1}{n+\\cfrac{1}{n+\\cdots}}} = \\frac{n + \\sqrt{n^2 + 4}}{2}\" width=\"344\" height=\"110\" \/><\/p>\n<p>The golden ratio is\u00a0<em>M<\/em>(1), the silver ratio is\u00a0<em>M<\/em>(2), and the bronze ratio is\u00a0<em>M<\/em>(3).<\/p>\n<h2>Gold from silver and bronze?<\/h2>\n<p>Can you make the golden ratio out of the silver and bronze ratios? Not by integer arithmetic. The golden ratio involves \u221a5, the silver ratio \u221a2 and the bronze ratio \u221a13. No integer operations on the latter two radicals will produce the former, though you can come arbitrarily close.<\/p>\n<h2>Gold from lead<\/h2>\n<p>The metallic ratios for <em>n<\/em> &gt; 3 don&#8217;t have standard names, but let&#8217;s call <em>M<\/em>(4) the lead ratio. Can you make the golden ratio out of the lead ratio? Yes you can:<\/p>\n<p style=\"padding-left: 40px;\"><em>M<\/em>(1) = (<em>M<\/em>(4) \u2212 1)\/2.<\/p>\n<h2>General solution<\/h2>\n<p>In general, when can you make\u00a0<em>M<\/em>(<em>n<\/em>) out of\u00a0<em>M<\/em>(<em>m<\/em>)? In abstract terms the question is when the fields<\/p>\n<p style=\"padding-left: 40px;\">\u211a(\u221a(<em>n<\/em>\u00b2 + 4))<\/p>\n<p>and<\/p>\n<p style=\"padding-left: 40px;\">\u211a(\u221a(<em>m<\/em>\u00b2 + 4))<\/p>\n<p>are the same, i.e. when adjoining \u221a(<em>n<\/em>\u00b2 + 4) to the rational numbers gives the same field as adjoining \u221a(<em>m<\/em>\u00b2 + 4) to the rational numbers. This occurs if and only if<\/p>\n<p style=\"padding-left: 40px;\">(<em>n<\/em>\u00b2 + 4)\/(<em>m\u00b2<\/em> + 4)<\/p>\n<p>is the square of a rational number.<\/p>\n<h2>Bronze from copper and tin<\/h2>\n<p>Can you make bronze out of copper and tin? Yes, if you define\u00a0<em>M<\/em>(36) to be the copper ratio and\u00a0<em>M<\/em>(393) to be the tin ratio, because<\/p>\n<p style=\"padding-left: 40px;\">(3\u00b2 + 4)\/(36\u00b2 + 4) = (1\/10)\u00b2<\/p>\n<p>and<\/p>\n<p style=\"padding-left: 40px;\">(3\u00b2 + 4)\/(292\u00b2 + 4) = (1\/109)\u00b2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After writing the previous post about metallic ratios, I thought about the analogy to alchemy and the attempt to make precious metals out of base metals. When can you make one metallic ratio out of another? Can you make the golden ratio out of the lead ratio? Before we can make gold out of lead, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[94],"class_list":["post-247536","post","type-post","status-publish","format-standard","hentry","category-math","tag-number-theory"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"number theory\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Metallic alchemy: making one metallic ratio from another\" \/>\n\t\t<meta property=\"og:description\" content=\"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-04T13:18:58+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-05T01:20:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Metallic alchemy: making one metallic ratio from another\" \/>\n\t\t<meta name=\"twitter:description\" content=\"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Metallic alchemy: making one metallic ratio from another","description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/","robots":"max-image-preview:large","keywords":"number theory","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Metallic alchemy: making one metallic ratio from another","og:description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/","article:published_time":"2026-08-04T13:18:58+00:00","article:modified_time":"2026-08-05T01:20:01+00:00","twitter:card":"summary","twitter:title":"Metallic alchemy: making one metallic ratio from another","twitter:description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247536","title":"Metallic alchemy: making one metallic ratio from another","description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-04 12:23:52","updated":"2026-08-05 17:40:38","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMathematical alchemy\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Mathematical alchemy","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247536"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247536\/revisions"}],"predecessor-version":[{"id":247539,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247536\/revisions\/247539"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247532,"date":"2026-08-04T06:41:49","date_gmt":"2026-08-04T11:41:49","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247532"},"modified":"2026-08-04T06:41:49","modified_gmt":"2026-08-04T11:41:49","slug":"ratio-of-metallic-ratios","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/","title":{"rendered":"Ratio of metallic ratios"},"content":{"rendered":"<p>The golden ratio is the first and best known of the metallic ratios. I&#8217;ve written about the silver ratio a few times, most recently <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/\">here<\/a>. And I&#8217;ve mentioned the <a href=\"https:\/\/www.johndcook.com\/blog\/2023\/04\/14\/metallic-ratios\/\">bronze ratio<\/a> a couple times. The metallic ratios after bronze don&#8217;t have standard names.<\/p>\n<p>The <em>n<\/em>th metallic ratio <em>M<\/em>(<em>n<\/em>) is the number whose continued fraction representation contains all <em>n<\/em>s.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/metallic_ratio.svg\" alt=\"n + \\cfrac{1}{n+\\cfrac{1}{n+\\cfrac{1}{n+\\cdots}}} = \\frac{n + \\sqrt{n^2 + 4}}{2}\" width=\"276\" height=\"95\" \/><\/p>\n<p>When <em>n<\/em> = 1, 2, and 3 we get the gold, silver, and bronze ratios.<\/p>\n<p>You can approximate any positive real number as a ratio of metallic ratios. To see this, note that for large\u00a0<em>n<\/em>, <i>M<\/i>(<em>n<\/em>)\u00a0is approximately\u00a0<em>n<\/em>. For any positive rational number <em>a<\/em>\/<em>b<\/em>,<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/metallic_ratio_ratio.svg\" alt=\"\\lim_{n\\to\\infty} \\frac{M(na)}{M(nb)} = \\frac{a}{b}\" width=\"131\" height=\"45\" \/><\/p>\n<p>and so you can make\u00a0<em>M<\/em>(<em>na<\/em>) \/\u00a0<em>M<\/em>(<em>nb<\/em>) as close to\u00a0<em>a<\/em>\/<em>b<\/em> as you like by taking\u00a0<em>n<\/em> large enough. And since the rationals are dense in the reals, you can approximate any positive real number as close as you&#8217;d like.<\/p>\n<p>Let&#8217;s look for metallic ratios whose ratios approximate \u03c0 to within 0.001 with the following Python code.<\/p>\n<pre>from math import pi, sqrt\r\n\r\nM = lambda n: 0.5*(n + sqrt(n**2 + 4))\r\n\r\nfor n in range(1, 100):\r\n    a = round(pi*n)\r\n    b = n\r\n    r = M(a)\/M(b)\r\n    if abs(r - pi) &lt; 0.001:\r\n        print(a, b, r)\r\n<\/pre>\n<p>This shows<\/p>\n<p style=\"padding-left: 40px;\">\u03c0 \u2248\u00a0<em>M<\/em>(132) \/\u00a0<em>M<\/em>(42) = 3.1412\u2026<\/p>\n<p>Could we find smaller numbers that work? The following code shows the answer is no.<\/p>\n<pre>k = 132 + 42\r\n# loop over numbers whose sum is less than k\r\nfor n in range(1, k):\r\n    for a in range(1, n):\r\n        b = n - a\r\n        r = M(a)\/M(b)\r\n        if abs(r - pi) &lt; 0.001:\r\n            print(a, b, r)\r\n            exit()\r\n<\/pre>\n<h2>Related posts<\/h2>\n<ul>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2024\/09\/01\/pell-numbers\/'>Pell is to silver as Fibonacci is to gold<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2024\/10\/10\/golden-ellipse\/'>Golden ellipse<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/'>Derivative equals inverse<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The golden ratio is the first and best known of the metallic ratios. I&#8217;ve written about the silver ratio a few times, most recently here. And I&#8217;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#8217;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-247532","post","type-post","status-publish","format-standard","hentry","category-math"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The golden ratio is the first and best known of the metallic ratios. I&#039;ve written about the silver ratio a few times, most recently here. And I&#039;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#039;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Ratio of metallic ratios\" \/>\n\t\t<meta property=\"og:description\" content=\"The golden ratio is the first and best known of the metallic ratios. I&#039;ve written about the silver ratio a few times, most recently here. And I&#039;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#039;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-04T11:41:49+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-04T11:41:49+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Ratio of metallic ratios\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The golden ratio is the first and best known of the metallic ratios. I&#039;ve written about the silver ratio a few times, most recently here. And I&#039;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#039;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Ratio of metallic ratios","description":"The golden ratio is the first and best known of the metallic ratios. I've written about the silver ratio a few times, most recently here. And I've mentioned the bronze ratio a couple times. The metallic ratios after bronze don't have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Ratio of metallic ratios","og:description":"The golden ratio is the first and best known of the metallic ratios. I've written about the silver ratio a few times, most recently here. And I've mentioned the bronze ratio a couple times. The metallic ratios after bronze don't have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/","article:published_time":"2026-08-04T11:41:49+00:00","article:modified_time":"2026-08-04T11:41:49+00:00","twitter:card":"summary","twitter:title":"Ratio of metallic ratios","twitter:description":"The golden ratio is the first and best known of the metallic ratios. I've written about the silver ratio a few times, most recently here. And I've mentioned the bronze ratio a couple times. The metallic ratios after bronze don't have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247532","title":null,"description":null,"keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-04 10:51:59","updated":"2026-08-05 17:40:38","ai":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRatio of metallic ratios\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Ratio of metallic ratios","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247532"}],"version-history":[{"count":1,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247532\/revisions"}],"predecessor-version":[{"id":247535,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247532\/revisions\/247535"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247524,"date":"2026-08-02T15:47:53","date_gmt":"2026-08-02T20:47:53","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247524"},"modified":"2026-08-04T04:57:39","modified_gmt":"2026-08-04T09:57:39","slug":"holonomic-functions","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/","title":{"rendered":"Holonomic functions"},"content":{"rendered":"<p><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/\">Yesterday<\/a> I wrote that a lot of the special functions that pop up in mathematical physics are solutions to second order linear differential equations with polynomial coefficients. More generally,<strong> holonomic functions<\/strong> are defined to be those functions that are the solutions to linear differential equations, of any order, with polynomial coefficients.<\/p>\n<p>Most special functions are holonomic. To quantify that statement, I went through the special functions covered in Abramowitz and Stegun. The large majority are holonomic, though some common functions like the gamma function are not holonomic.<\/p>\n<p><a href=\"https:\/\/www.johndcook.com\/holonomic_odes_abramowitz_stegun.pdf\">This report<\/a> goes through the functions in A&amp;S. For those that are holonomic, it gives the differential equation that the function solves. The large majority of these equations are second order, but not all. And the coefficients are nearly always first or second order polynomials, rarely higher order.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I wrote that a lot of the special functions that pop up in mathematical physics are solutions to second order linear differential equations with polynomial coefficients. More generally, holonomic functions are defined to be those functions that are the solutions to linear differential equations, of any order, with polynomial coefficients. Most special functions are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47,129],"class_list":["post-247524","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations","tag-special-functions"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations,special functions\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Holonomic functions\" \/>\n\t\t<meta property=\"og:description\" content=\"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-02T20:47:53+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-04T09:57:39+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Holonomic functions\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Holonomic functions","description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/","robots":"max-image-preview:large","keywords":"differential equations,special functions","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Holonomic functions","og:description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/","article:published_time":"2026-08-02T20:47:53+00:00","article:modified_time":"2026-08-04T09:57:39+00:00","twitter:card":"summary","twitter:title":"Holonomic functions","twitter:description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247524","title":null,"description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-02 20:34:46","updated":"2026-08-05 17:40:39","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHolonomic functions\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Holonomic functions","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247524"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247524\/revisions"}],"predecessor-version":[{"id":247531,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247524\/revisions\/247531"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247518,"date":"2026-08-02T12:57:31","date_gmt":"2026-08-02T17:57:31","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247518"},"modified":"2026-08-02T19:20:01","modified_gmt":"2026-08-03T00:20:01","slug":"estimating-a-cumulative-sum","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/","title":{"rendered":"Estimating a cumulative sum"},"content":{"rendered":"<p>In <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\">this post<\/a> I mentioned two series which I denoted\u00a0<em>t<\/em>(<em>n<\/em>) and\u00a0<em>c<\/em>(<em>n<\/em>). The former is the number of unlabeled rooted trees with\u00a0<em>n<\/em> nodes. The latter is the cumulative sum of the former, i.e.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp1.svg\" alt=\"c(n) =\u00a0t(1) +\u00a0t(2) +\u00a0t(3) + \\cdots +\u00a0t(n)\" width=\"320\" height=\"18\" \/><\/p>\n<p>The sequence\u00a0<em>c<\/em>(<em>n<\/em>) is also the number of constraints on an <em>n<\/em>-step Runge-Kutta method; that&#8217;s how I became interested in it.<\/p>\n<p>Now the\u00a0<em>t<\/em>(<em>n<\/em>) sequence has been cataloged as OEIS <a href=\"https:\/\/oeis.org\/A000081\">A000081<\/a> and OEIS gives the asymptotic estimate of\u00a0<em>t<\/em>(<em>n<\/em>) for large\u00a0<em>n<\/em> as<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp2.svg\" alt=\"t(n) \\sim C \\frac{a^n}{n^{3\/2}}\" width=\"105\" height=\"42\" \/><\/p>\n<p>where <em>C<\/em>\u00a0= 0.4399\u2026 and \u03b1 = 2.9557\u2026.<\/p>\n<p>The cumulative sum of\u00a0<em>t<\/em>(<em>n<\/em>), what I&#8217;ve called\u00a0<em>c<\/em>(<em>n<\/em>), is also cataloged in OEIS, sequence number <a href=\"https:\/\/oeis.org\/A087803\">A087803<\/a>. However, OEIS does not give an asymptotic estimate for this sequence. I&#8217;ll give one here.<\/p>\n<p>(Update: After looking closer at the page for A087803 I see that there is an asymptotic formula, the same one derived here.)<\/p>\n<p>The basis for my derivation is to assume the cumulative sum of the asymptotic estimates gives an asymptotic estimate of the cumulative sum. This is justified by the fact that the sequence is increasing rapidly and only the last few terms contribute much relatively to the sum.<\/p>\n<p>The technique illustrated here would be applicable to the cumulative sum of other series whose asymptotic form is known.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp.svg\" alt=\"\\begin{align*} c(n) &amp;= \\sum_{n=1}^N t(n) \\\\ &amp;\\sim \\sum_{n=1}^N C \\frac{a^n}{n^{3\/2}}\\\\ &amp;= C \\frac{a^N}{N^{3\/2}} \\sum_{k=0}^{N-1} a^{-k}\\left(1 - \\frac{k}{N} \\right)^{-3\/2} \\\\ &amp;\\sim C \\frac{a^N}{N^{3\/2}} \\sum_{k=0}^\\infty a^{-k} \\\\ &amp;= C \\frac{a^N}{N^{3\/2}} \\frac{a}{a-1} \\\\ &amp;= C \\frac{a^{N+1}}{(a-1)N^{3\/2}} \\end{align*} \" width=\"280\" height=\"371\" \/><\/p>\n<p>Here&#8217;s code to visualize the rate of convergence.<\/p>\n<pre>import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# from https:\/\/oeis.org\/A000081\/b000081.txt\r\nA000081 = [\r\n    0,\r\n    1,\r\n    1,\r\n    2,\r\n    4,\r\n    ...\r\n    51384328351659326880337136395054298255277970,\r\n]  \r\nA087803 = np.cumsum(A000081)\r\n\r\ndef approx(n):\r\n    C = 0.43992401257102530\r\n    a = 2.95576528565199497\r\n    return C*a**(n+1)*n**(-3\/2)\/(a - 1)\r\n\r\nn = np.arange(len(A087803))\r\nratio = A087803\/approx(n)\r\n\r\nplt.plot(n[1:], ratio[1:])\r\nplt.plot(n, 0*n + 1, '--')\r\nplt.xlabel(\"$n$\")\r\nplt.ylabel(\"exact\/approx\")\r\nplt.show()\r\n<\/pre>\n<p>Here&#8217;s the plot:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp_plot.png\" width=\"640\" height=\"480\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I mentioned two series which I denoted\u00a0t(n) and\u00a0c(n). The former is the number of unlabeled rooted trees with\u00a0n nodes. The latter is the cumulative sum of the former, i.e. The sequence\u00a0c(n) is also the number of constraints on an n-step Runge-Kutta method; that&#8217;s how I became interested in it. Now the\u00a0t(n) sequence [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-247518","post","type-post","status-publish","format-standard","hentry","category-math"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Estimating a cumulative sum\" \/>\n\t\t<meta property=\"og:description\" content=\"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-02T17:57:31+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-03T00:20:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Estimating a cumulative sum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Estimating a cumulative sum","description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Estimating a cumulative sum","og:description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/","article:published_time":"2026-08-02T17:57:31+00:00","article:modified_time":"2026-08-03T00:20:01+00:00","twitter:card":"summary","twitter:title":"Estimating a cumulative sum","twitter:description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247518","title":null,"description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-02 13:16:46","updated":"2026-08-05 17:40:39","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tEstimating a cumulative sum\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Estimating a cumulative sum","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247518"}],"version-history":[{"count":6,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247518\/revisions"}],"predecessor-version":[{"id":247527,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247518\/revisions\/247527"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247512,"date":"2026-08-01T15:18:41","date_gmt":"2026-08-01T20:18:41","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247512"},"modified":"2026-08-01T16:13:18","modified_gmt":"2026-08-01T21:13:18","slug":"why-polynomial-coefficients","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/","title":{"rendered":"Why polynomial coefficients?"},"content":{"rendered":"<p>Second order linear differential equations with polynomial coefficients form their own area of study. This seems like a narrow class of equations, but it&#8217;s very important in applications.<\/p>\n<p>This class of equations seems like a mathematically natural topic, but why is it so important in applications? I did a PhD in differential equations without ever learning why. The theory of second order linear equations with polynomial coefficients is too complicated for undergraduate courses [0] and too well-established for graduate courses [1]. <\/p>\n<p>The explanation that I was missing can be found in the first chapter of [2]. The PDEs that are common in physics are separable in various coordinate systems, meaning that in these coordinate systems the PDEs reduce to ODEs. These ODEs either have polynomial coefficients, or there is a change of variables which makes the ODEs have polynomial coefficients.<\/p>\n<p>See this <a href=\"https:\/\/www.johndcook.com\/separable_helmholtz.pdf\">writeup<\/a> that looks at the Helmholtz and Laplace equations in 11 coordinate systems.<\/p>\n<p>[0] You may see the simplest parts of the theory in a section on solving ODEs with power series. But textbooks don&#8217;t go very far for good reasons.<\/p>\n<p>[1] Unfortunately, a lot of really useful topics are left out of the graduate curriculum because they&#8217;re too well understood to provide thesis topics. Or the problems that are still open have been open for so long that they&#8217;re likely too hard to be cracked by a graduate student.<\/p>\n<p>[2] Gerhard Kristensson. Second Order Differential Equations: Special Functions and their Classification. Springer, 2010.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Second order linear differential equations with polynomial coefficients form their own area of study. This seems like a narrow class of equations, but it&#8217;s very important in applications. This class of equations seems like a mathematically natural topic, but why is it so important in applications? I did a PhD in differential equations without ever [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47,170],"class_list":["post-247512","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations","tag-science"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations,science\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Why polynomial coefficients?\" \/>\n\t\t<meta property=\"og:description\" content=\"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-01T20:18:41+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-01T21:13:18+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Why polynomial coefficients?\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Why polynomial coefficients?","description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/","robots":"max-image-preview:large","keywords":"differential equations,science","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Why polynomial coefficients?","og:description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/","article:published_time":"2026-08-01T20:18:41+00:00","article:modified_time":"2026-08-01T21:13:18+00:00","twitter:card":"summary","twitter:title":"Why polynomial coefficients?","twitter:description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247512","title":null,"description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-01 18:36:06","updated":"2026-08-05 17:40:39","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWhy polynomial coefficients?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Why polynomial coefficients?","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247512"}],"version-history":[{"count":4,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247512\/revisions"}],"predecessor-version":[{"id":247516,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247512\/revisions\/247516"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247502,"date":"2026-08-01T11:15:53","date_gmt":"2026-08-01T16:15:53","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247502"},"modified":"2026-08-05T11:19:04","modified_gmt":"2026-08-05T16:19:04","slug":"counting-rooted-trees","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/","title":{"rendered":"Counting rooted trees"},"content":{"rendered":"<p>Combinatorial problems can be interesting for their own sake, but they are more interesting when there is a connection to a problem outside combinatorics, and the more unexpected the connection the better.<\/p>\n<p>Counting the number of unlabeled rooted trees [1] with <em>n<\/em> nodes is a pure mathematics problem. Designing numerical methods for solving differential equations is an applied mathematics problem. And yet the two are closely linked.<\/p>\n<p>Let <em>t<\/em>(<em>n<\/em>) be the number of distinct unlabeled rooted trees with <em>n<\/em> nodes. The diagram below shows that the first few terms of this sequence are 1, 1, 2, and 4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/rooted_trees_order_1_to_4.svg\" width=\"680\" height=\"600\" \/><\/p>\n<h2>Recursive calculation<\/h2>\n<p>The values of\u00a0<em>t<\/em>(<em>n<\/em>) can be computed recursively using<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/counting_trees.svg\" alt=\"\\begin{align*} g_k &amp;= \\sum_{d\\mid k} d t_d \\\\ t_1 &amp;= 1 \\\\ t_n &amp;= \\frac{1}{n-1} \\sum_{k=1}^{n-1} g_k t_{n-k} \\text{ for } n &gt; 1&lt;br \/&gt;\n\\end{align*}&lt;br \/&gt;\n\" width=\"247\" height=\"147\" \/><\/p>\n<p>You can implement this in Python as follows.<\/p>\n<pre>from sympy import divisors\r\n\r\ndef t(n):\r\n    if n &lt;= 1:\r\n        return 1 if n == 1 else 0\r\n    return sum(g(k) * t(n - k) for k in range(1, n)) \/\/ (n - 1)\r\n\r\ndef g(k):\r\n    return sum(d * t(d) for d in divisors(k))\r\n<\/pre>\n<p>This code is correct, but it will run more efficiently if you cache function values to avoid calculating the same values over and over. You can do this by adding<\/p>\n<pre>from functools import lru_cache<\/pre>\n<p>and writing <code>@lru_cache(maxsize=None)<\/code> above both function definitions.<\/p>\n<h2>Connection to Runge-Kutta<\/h2>\n<p>In an <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\">earlier post<\/a> I showed that designing a 4-stage explicit Runge-Kutta method required solving a system of 8 equations in 10 unknowns, leaving two degrees of freedom in the solutions.<\/p>\n<p>The number of constraints <em>c<\/em>(<em>s<\/em>) needed to design an <em>s<\/em>-stage explicit RK method is equal to the number of rooted trees with up to <em>s<\/em> nodes:<\/p>\n<p style=\"padding-left: 40px;\"><em>c<\/em>(<em>s<\/em>) = <em>t<\/em>(1) + <em>t<\/em>(2) + <em>t<\/em>(3) + \u2026 + <em>t<\/em>(<em>s<\/em>)<\/p>\n<p>This is because there is a one-to-one correspondence between constraints on the <em>n<\/em>th derivative of an RK formula and rooted trees, and an\u00a0<em>s<\/em> stage method has to satisfy the constraints of all stages up to\u00a0<em>s<\/em>. In the example of the 4th order RK method, we have<\/p>\n<p style=\"padding-left: 40px;\"><em>c<\/em>(4) =\u00a0<em>t<\/em>(1) +\u00a0<em>t<\/em>(2)\u00a0 +\u00a0<em>t<\/em>(3) +\u00a0<em>t<\/em>(4) = 1 + 1 + 2 + 4 = 8.<\/p>\n<p>The first few values [2] of <em>t<\/em>(<em>n<\/em>) are<\/p>\n<p style=\"padding-left: 40px;\">1, 1, 2, 4, 9, 20, 48, 115, 286, 719, 1842, 4766, 12486, 32973, \u2026<\/p>\n<p>and so you can see that\u00a0<em>t<\/em>(<em>n<\/em>) grows quickly. In fact, it grows exponentially [3].<\/p>\n<p>However, the number of parameters in an\u00a0<em>s<\/em> stage RK method is\u00a0<em>s<\/em>(<em>s<\/em> + 1)\/2. The number of equations grows exponentially and the number of variables grows only quadratically, so at some point you have more equations than variables. That&#8217;s already the case for <em>s<\/em> = 5 because you have 17 constraints on 15 variables.\u00a0The system has a solution because symmetry considerations render some of the equations redundant.<\/p>\n<p>A 10th order RK method requires 17 stages. (See the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/\">previous post<\/a> for why the number of stages exceeds the order when the order is greater than 4.) Designing such a method would require solving over a million equations in 153 variables, and yet it can be done. [4]<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\">Solving the RK4 equations<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/27\/counting-permutations-with-roots\/\">Counting permutations with roots<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/dna-sequence-alignment-and-kings\/\">DNA alignment and Kings<\/a><\/li>\n<\/ul>\n<p>[1] This is a slightly contradictory term. Unlabeled means the we don&#8217;t distinguish the nodes. But we do distinguish one node, namely the root.<\/p>\n<p>[2] See OEIS <a href=\"https:\/\/oeis.org\/A000081\">A000081<\/a>.<\/p>\n<p>[2] Richard Otter proved in 1948 that the number of unlabeled rooted trees with\u00a0<em>n<\/em> nodes is asymptotically <em>C<\/em> \u03b1<sup><em>n<\/em><\/sup> \/ <em>n<\/em><sup>\u22123\/2<\/sup> where\u00a0<em>C<\/em> = 0.4399\u2026 and \u03b1 = 2.9557\u2026. The cumulative sum is at least this large since Otter&#8217;s estimate gives the size of the last term in the sum.<\/p>\n<p>[3] E. Hairer. A Runge-Kutta Method of Order 10. J. Inst. Maths Applics (1978) 21, 47-59<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Combinatorial problems can be interesting for their own sake, but they are more interesting when there is a connection to a problem outside combinatorics, and the more unexpected the connection the better. Counting the number of unlabeled rooted trees [1] with n nodes is a pure mathematics problem. Designing numerical methods for solving differential equations [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[197,47],"class_list":["post-247502","post","type-post","status-publish","format-standard","hentry","category-math","tag-combinatorics","tag-differential-equations"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"combinatorics,differential equations\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Counting rooted trees\" \/>\n\t\t<meta property=\"og:description\" content=\"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-01T16:15:53+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-05T16:19:04+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Counting rooted trees\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Counting rooted trees","description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/","robots":"max-image-preview:large","keywords":"combinatorics,differential equations","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Counting rooted trees","og:description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/","article:published_time":"2026-08-01T16:15:53+00:00","article:modified_time":"2026-08-05T16:19:04+00:00","twitter:card":"summary","twitter:title":"Counting rooted trees","twitter:description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247502","title":null,"description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-01 14:08:24","updated":"2026-08-05 17:40:39","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCounting rooted trees\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Counting rooted trees","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247502"}],"version-history":[{"count":10,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247502\/revisions"}],"predecessor-version":[{"id":247545,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247502\/revisions\/247545"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247499,"date":"2026-08-01T10:58:15","date_gmt":"2026-08-01T15:58:15","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247499"},"modified":"2026-08-01T10:58:15","modified_gmt":"2026-08-01T15:58:15","slug":"butcher-barrier","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/","title":{"rendered":"Runge-Kutta order versus stages"},"content":{"rendered":"<p>The textbook version of the Runge-Kutta method for solving differential equations has 4 stages and has 4th order error. For lower order versions of RK the number of stages <em>s<\/em> also matches the order of the error <em>p<\/em>. But in order to achieve error on the order of\u00a0<em>p<\/em> \u2265 5, you need more than <em>p<\/em> stages. This is known as the Butcher barrier.<\/p>\n<p>Before going any further, let&#8217;s back up and say what we mean by stages and by order.<\/p>\n<h2>Stages<\/h2>\n<p>The number of stages in an RK method to solve the equation<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/first_order_ode.svg\" alt=\"y' = f(t, y)\" width=\"82\" \/><\/p>\n<p>is the number of evaluations of the function\u00a0<em>f<\/em> on the right-hand side. For example, the textbook RK4 method estimates the solution at each step by<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/rk4.svg\" alt=\"y_{n+1} = y_n + \\frac{h}{6}\\left( k_{n1} + 2k_{n2} + 2k_{n3} + k_{n4}\\right)\" width=\"305\" \/><\/p>\n<p>where<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/rk4k.svg\" alt=\"k_{n1} &amp;=&amp; f(t_n, y_n) \\\\ k_{n2} &amp;=&amp; f(t_n + 0.5h, y_n + 0.5hk_{n1}) \\\\ k_{n3} &amp;=&amp; f(t_n + 0.5h, y_n + 0.5hk_{n2}) \\\\ k_{n4} &amp;=&amp; f(t_n + h, y_n + hk_{n3}) \\\\\" width=\"280\" \/><\/p>\n<p>which requires four stages, i.e. four evaluations of\u00a0<em>f<\/em>.<\/p>\n<h2>Order<\/h2>\n<p>A differential equation solver is said to have order <em>p<\/em> if the local error, the error after one step of size <em>h<\/em>, is <em>O<\/em>(<em>h<\/em><sup><em>p<\/em> + 1<\/sup>). Then after solving an ODE over a period of time <em>T<\/em> with <em>N<\/em> = <em>T<\/em>\/<em>h<\/em> steps, the global error is <em>O<\/em>(<em>h<\/em><sup><em>p<\/em><\/sup>). So, for example, if <em>p<\/em> = 4, you would expect that cutting your step size <em>h<\/em> in half would cut your error at <em>T<\/em> by a factor of 16.<\/p>\n<h2>More stages than the order<\/h2>\n<p>John C. Butcher proved that an explicit RK method of order <em>p<\/em> requires\u00a0<em>s<\/em> stages where\u00a0<em>s<\/em> &gt;\u00a0<em>p<\/em> if\u00a0<em>p<\/em> &gt; 4.<\/p>\n<p>An important example is the Dormand-Prince method. It is a version of RK that has order 5 and 7 stages. The clever thing about this method is that you can make a 4th order solver out of a subset of its function evaluations.<\/p>\n<p>That means that after you&#8217;ve evaluated one step of the 5th order method, you can also evaluate a 4th order method essentially for free. And by comparing them, you can get a sense of the error. If the solutions given by the two methods are substantially different, you have probably taken too big a step and need to back up. If the two solutions essentially agree, you&#8217;re probably good to take the next step.<\/p>\n<p>For an explict RK method to have order 5, 6, or 7 you need at least 6, 7, or 9 stages respectively.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The textbook version of the Runge-Kutta method for solving differential equations has 4 stages and has 4th order error. For lower order versions of RK the number of stages s also matches the order of the error p. But in order to achieve error on the order of\u00a0p \u2265 5, you need more than p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47],"class_list":["post-247499","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Runge-Kutta: over versus stages | Butcher barrier\" \/>\n\t\t<meta property=\"og:description\" content=\"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-01T15:58:15+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-01T15:58:15+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Runge-Kutta: over versus stages | Butcher barrier\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Runge-Kutta: over versus stages | Butcher barrier","description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/","robots":"max-image-preview:large","keywords":"differential equations","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Runge-Kutta: over versus stages | Butcher barrier","og:description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/","article:published_time":"2026-08-01T15:58:15+00:00","article:modified_time":"2026-08-01T15:58:15+00:00","twitter:card":"summary","twitter:title":"Runge-Kutta: over versus stages | Butcher barrier","twitter:description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247499","title":"Runge-Kutta: over versus stages | Butcher barrier","description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-01 11:53:29","updated":"2026-08-05 17:40:39","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRunge-Kutta order versus stages\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Runge-Kutta order versus stages","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247499"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247499\/revisions"}],"predecessor-version":[{"id":247506,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247499\/revisions\/247506"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247492,"date":"2026-07-31T13:59:02","date_gmt":"2026-07-31T18:59:02","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247492"},"modified":"2026-08-01T20:51:08","modified_gmt":"2026-08-02T01:51:08","slug":"runge-kutta-design","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/","title":{"rendered":"Solving the RK4 design equations"},"content":{"rendered":"<p>I was digging into the Runge-Kutta method for solving differential equations and a line from [1] piqued my curiosity.<\/p>\n<p style=\"padding-left: 40px;\">These calculations, which are not reproduced in Kutta&#8217;s paper (they are however in Huen (1900)), are very tedious.<\/p>\n<p>The calculations are a set of eight constraints that the parameters of a fourth-order Runge-Kutta method must satisfy. I wondered how well Mathematica might have done at assisting Mr. Huen in his &#8220;very tedious&#8221; calculations if it had been available in 1900.<\/p>\n<p>I go into Runge-Kutta methods in <a href=\"https:\/\/www.johndcook.com\/blog\/2020\/02\/13\/runge-kutta-methods\/\">this post<\/a>. Here I&#8217;d like to concentrate on a step in the design of the methods, namely solving the set of equations alluded in the quote above.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/RK4.svg\" alt=\"\\begin{align*} b_1 + b_2 + b_3 + b_4 &amp;= 1 \\\\ b_2 c_2 + b_3 c_3 + b_4 c_4 &amp;= \\frac{1}{2} \\\\ b_2 c_2^2 + b_3 c_3^2 + b_4 c_4^2 &amp;= \\frac{1}{3} \\\\ b_3 a_{32} c_2 + b_4(a_{42} c_2 + a_{43} c_3) &amp;= \\frac{1}{6} \\\\ b_2 c_2^3 + b_3 c_3^3 + b_4 c_4^3 &amp;= \\frac{1}{4} \\\\ b_3 c_3 a_{32} c_2 + b_4 c_4(a_{42} c_2 + a_{43} c_3) &amp;= \\frac{1}{8} \\\\ b_3 a_{32} c_2^2 + b_4(a_{42} c_2^2 + a_{43} c_3^2) &amp;= \\frac{1}{12} \\\\ b_4 a_{43} a_{32} c_2 &amp;= \\frac{1}{24} \\end{align*} \" width=\"297\" height=\"353\" \/><\/p>\n<p>The first thing to note is that there are 10 variables and only 8 equations, and so the solution is not fully determined. What we think of as\u00a0<em>the<\/em> fourth order Runge-Kutta method is in fact\u00a0<em>a<\/em> fourth order Runge-Kutta method.<\/p>\n<p>One could argue that we should have <em>b<\/em><sub>2<\/sub> = <em>b<\/em><sub>3<\/sub> and <em>c<\/em><sub>2<\/sub> = <em>c<\/em><sub>3<\/sub>. With these additional equations, the system of equations has a unique solution, and Mathematic finds it easily.<\/p>\n<pre>eqs = {\r\n    b1 + b2 + b3 + b4 == 1,\r\n    b2*c2 + b3*c3 + b4*c4 == 1\/2,\r\n    b2*c2^2 + b3*c3^2 + b4*c4^2 == 1\/3,\r\n    b3*a32*c2 + b4*(a42*c2 + a43*c3) == 1\/6,\r\n    b2*c2^3 + b3*c3^3 + b4*c4^3 == 1\/4,\r\n    b3*c3*a32*c2 + b4*c4*(a42*c2 + a43*c3) == 1\/8,\r\n    b3*a32*c2^2 + b4*(a42*c2^2 + a43*c3^2) == 1\/12,\r\n    b4*a43*a32*c2 == 1\/24,\r\n    b2 == b3,\r\n    c2 == c3\r\n};\r\n\r\nvars = {b1, b2, b3, b4, c2, c3, c4, a32, a42, a43};\r\n\r\nsolution = Solve[eqs, vars]\r\n<\/pre>\n<p>This returns the parameters used for the version of Runge-Kutta presented in every textbook.<\/p>\n<p>If you keep the requirement <em>b<\/em><sub>2<\/sub> = <em>b<\/em><sub>3<\/sub> but substitute the requirement 2<em>c<\/em><sub>2<\/sub> = <em>c<\/em><sub>3<\/sub> for <em>c<\/em>&#8216;s Mathematica will return the coefficients for the so-called Runge-Kutta 3\/8 rule. This method has some slight advantages by some criteria.<\/p>\n<p>In 1951 Gill [2] discovered a fourth order Runge-Kutta rule optimized for running in extremely constrained computer hardware. It&#8217;s a strange method, with irrational parameters, but one that was a very clever response to the limitations of its time.<\/p>\n<p><strong>Update<\/strong>: See <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\">this post<\/a> for a discussion of the parameters and constriants for higher-ordered RK methods.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2020\/02\/19\/dormand-prince\/\">Dormand and Prince<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2016\/06\/02\/ode-solver-as-a-functional-fold\/\">RK4 as a fold<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2020\/02\/02\/stiff-differential-equations\/\">Stiff differential equations<\/a><\/li>\n<\/ul>\n<p>[1] Hairer, N\u00f8rsett, and Wanner. Solving Ordinary Differential Equations I: Nonstiff Problems. Springer-Verlag 1987.<\/p>\n<p>[2] A. Gill. A process for the step-by-step integration of differential equations in an automatic digital computing machine. Proc. Cambridge Philos. Soc., vol 27, pp 95\u2013108.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was digging into the Runge-Kutta method for solving differential equations and a line from [1] piqued my curiosity. These calculations, which are not reproduced in Kutta&#8217;s paper (they are however in Huen (1900)), are very tedious. The calculations are a set of eight constraints that the parameters of a fourth-order Runge-Kutta method must satisfy. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47,87],"class_list":["post-247492","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations","tag-mathematica"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations,mathematica\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Solving the fourth order Runge-Kutta design equations\" \/>\n\t\t<meta property=\"og:description\" content=\"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-07-31T18:59:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-02T01:51:08+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Solving the fourth order Runge-Kutta design equations\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Solving the fourth order Runge-Kutta design equations","description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/","robots":"max-image-preview:large","keywords":"differential equations,mathematica","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Solving the fourth order Runge-Kutta design equations","og:description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/","article:published_time":"2026-07-31T18:59:02+00:00","article:modified_time":"2026-08-02T01:51:08+00:00","twitter:card":"summary","twitter:title":"Solving the fourth order Runge-Kutta design equations","twitter:description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247492","title":"Solving the fourth order Runge-Kutta design equations","description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-07-31 17:38:42","updated":"2026-08-05 17:40:39","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tSolving the RK4 design equations\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Solving the RK4 design equations","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247492"}],"version-history":[{"count":5,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247492\/revisions"}],"predecessor-version":[{"id":247517,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247492\/revisions\/247517"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]