{"id":1566,"date":"2024-12-05T06:19:21","date_gmt":"2024-12-05T06:19:21","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1566"},"modified":"2025-02-07T09:14:59","modified_gmt":"2025-02-07T09:14:59","slug":"double-integral","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/calculator\/double-integral\/","title":{"rendered":"Double Integral Calculator"},"content":{"rendered":"<p><center><div class=\"calculator-container\">\r\n        <h2>Double Integral Calculator<\/h2>\r\n        \r\n        <div class=\"input-group flex-row\">\r\n            <div>\r\n                <label>Lower Limit x (a):<\/label>\r\n                <input type=\"number\" id=\"lowerX\" placeholder=\"Enter lower x\">\r\n            <\/div>\r\n            <div>\r\n                <label>Upper Limit x (b):<\/label>\r\n                <input type=\"number\" id=\"upperX\" placeholder=\"Enter upper x\">\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div class=\"input-group flex-row\">\r\n            <div>\r\n                <label>Lower Limit y (c):<\/label>\r\n                <input type=\"number\" id=\"lowerY\" placeholder=\"Enter lower y\">\r\n            <\/div>\r\n            <div>\r\n                <label>Upper Limit y (d):<\/label>\r\n                <input type=\"number\" id=\"upperY\" placeholder=\"Enter upper y\">\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div class=\"input-group\">\r\n            <label>Integral Function f(x,y):<\/label>\r\n            <input type=\"text\" id=\"function\" placeholder=\"Enter function like x*y or x^2 + y^2\">\r\n        <\/div>\r\n\r\n        <button id=\"calculateBtn\">Calculate Integral<\/button>\r\n\r\n        <div id=\"result\"><\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        function parseFunction(func) {\r\n            \/\/ Simple function parser and evaluator\r\n            return (x, y) => {\r\n                try {\r\n                    \/\/ Replace power notation\r\n                    func = func.replace(\/\\^\/g, '**');\r\n                    \/\/ Create a function that can evaluate x and y\r\n                    return new Function('x', 'y', `return ${func}`)(x, y);\r\n                } catch(error) {\r\n                    throw new Error('Invalid function');\r\n                }\r\n            };\r\n        }\r\n\r\n        function simpleNumericIntegration(f, a, b, c, d, steps = 100) {\r\n            const dx = (b - a) \/ steps;\r\n            const dy = (d - c) \/ steps;\r\n            let total = 0;\r\n\r\n            for (let i = 0; i < steps; i++) {\r\n                for (let j = 0; j < steps; j++) {\r\n                    const x = a + (i + 0.5) * dx;\r\n                    const y = c + (j + 0.5) * dy;\r\n                    total += f(x, y) * dx * dy;\r\n                }\r\n            }\r\n\r\n            return total;\r\n        }\r\n\r\n        document.getElementById('calculateBtn').addEventListener('click', () => {\r\n            const resultDiv = document.getElementById('result');\r\n            resultDiv.innerHTML = '';\r\n\r\n            try {\r\n                const a = parseFloat(document.getElementById('lowerX').value);\r\n                const b = parseFloat(document.getElementById('upperX').value);\r\n                const c = parseFloat(document.getElementById('lowerY').value);\r\n                const d = parseFloat(document.getElementById('upperY').value);\r\n                const funcStr = document.getElementById('function').value;\r\n\r\n                \/\/ Validate inputs\r\n                if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\r\n                    throw new Error('Please enter valid numeric limits');\r\n                }\r\n\r\n                if (b <= a) throw new Error('Upper x limit must be greater than lower x limit');\r\n                if (d <= c) throw new Error('Upper y limit must be greater than lower y limit');\r\n\r\n                const f = parseFunction(funcStr);\r\n                const result = simpleNumericIntegration(f, a, b, c, d);\r\n\r\n                resultDiv.innerHTML = `\u222b\u222b ${funcStr} dx dy = ${result.toFixed(4)}`;\r\n                resultDiv.style.color = 'var(--primary-color)';\r\n            } catch (error) {\r\n                resultDiv.innerHTML = `Error: ${error.message}`;\r\n                resultDiv.style.color = 'var(--accent-color)';\r\n            }\r\n        });\r\n    <\/script><\/center><\/p>\n<section>&nbsp;<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-1566","post","type-post","status-publish","format-standard","hentry","category-calculator"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Double Integral Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"A double integral is a mathematical tool used in multivariable calculus to compute the accumulation of a function&#039;s values over a two-dimensional area\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/calculator\/double-integral\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Double Integral Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"A double integral is a mathematical tool used in multivariable calculus to compute the accumulation of a function&#039;s values over a two-dimensional area\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/calculator\/double-integral\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-05T06:19:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T09:14:59+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Double Integral Calculator - DonHit","description":"A double integral is a mathematical tool used in multivariable calculus to compute the accumulation of a function's values over a two-dimensional area","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/donhit.com\/en\/calculator\/double-integral\/","og_locale":"en_US","og_type":"article","og_title":"Double Integral Calculator - DonHit","og_description":"A double integral is a mathematical tool used in multivariable calculus to compute the accumulation of a function's values over a two-dimensional area","og_url":"https:\/\/donhit.com\/en\/calculator\/double-integral\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-12-05T06:19:21+00:00","article_modified_time":"2025-02-07T09:14:59+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/calculator\/double-integral\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/calculator\/double-integral\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Double Integral Calculator","datePublished":"2024-12-05T06:19:21+00:00","dateModified":"2025-02-07T09:14:59+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/calculator\/double-integral\/"},"wordCount":9,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Calculator"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/calculator\/double-integral\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/calculator\/double-integral\/","url":"https:\/\/donhit.com\/en\/calculator\/double-integral\/","name":"Double Integral Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-12-05T06:19:21+00:00","dateModified":"2025-02-07T09:14:59+00:00","description":"A double integral is a mathematical tool used in multivariable calculus to compute the accumulation of a function's values over a two-dimensional area","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/calculator\/double-integral\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/calculator\/double-integral\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/calculator\/double-integral\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Calculator","item":"https:\/\/donhit.com\/en\/category\/calculator\/"},{"@type":"ListItem","position":3,"name":"Double Integral Calculator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1566"}],"version-history":[{"count":4,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1566\/revisions"}],"predecessor-version":[{"id":2166,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1566\/revisions\/2166"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}