{"id":288445,"date":"2018-08-24T03:30:02","date_gmt":"2018-08-23T23:30:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288445"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-08-23T23:30:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288445","title":{"rendered":"\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u043e\u0432: \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420867\/\" class=\"post__text post__text-html js-mediator-article\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/u9\/v3\/cz\/u9v3czzjh1wakdvjgj5u64tyxhy.gif\" alt=\"image\"><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435, \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"https:\/\/www.gnu.org\/software\/gsl\/\">GNU Scientific Library<\/a> \u0434\u043b\u044f C, <a href=\"https:\/\/www.scipy.org\/\">SciPy<\/a> \u0434\u043b\u044f Python \u0438 \u0434\u0440\u0443\u0433\u0438\u0445. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187;, \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0447\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"opredelenie-integrala\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430<\/h3>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u043e\u043c (\u043f\u043e \u0420\u0438\u043c\u0430\u043d\u0443) \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math> \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/356\/594\/519\/3565945194c7fa6e415c402c0bc5f884.svg\" alt=\"$[a;b]$\" data-tex=\"inline\"><\/math> \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0435\u0434\u0435\u043b:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f97\/9df\/323\/f979df323d22916e37db4d22b8dfa907.svg\" alt=\"$\\int_a^b f(x)dx = \\lim_{\\Delta x \\to 0} \\sum_{i=0}^{n-1} f(\\xi_i)(x_{i+1} - x_i),~~(1)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/306\/7f2\/4d1\/3067f24d1ec9a6d97edfd21ef93ef7d6.svg\" alt=\"$\\Delta x = \\max\\lbrace x_{i+1} - x_i\\rbrace$\" data-tex=\"inline\"><\/math> \u2014 \u043c\u0435\u043b\u043a\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/df5\/111\/5b2\/df51115b2b72b826d87a2b4d22ab4472.svg\" alt=\"$x_0 = a$\" data-tex=\"inline\"><\/math>, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6a8\/04a\/9db\/6a804a9dbd3a9ae14a444b42241768ac.svg\" alt=\"$x_n = b$\" data-tex=\"inline\"><\/math>, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b01\/0e8\/1d7\/b010e81d7d89ee97dedf50c138e445ae.svg\" alt=\"$\\xi_i$\" data-tex=\"inline\"><\/math> \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b8b\/468\/74a\/b8b46874a263e9a4d0a940867babfa5e.svg\" alt=\"$[x_i; x_{i+1}]$\" data-tex=\"inline\"><\/math>.<br \/>  \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, \u043b\u0438\u0448\u044c \u0431\u044b \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u0435\u043b\u043a\u0438\u043c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/v7\/8-\/m1\/v78-m1x-bgt79lmesfocurqftek.png\" alt=\"image\"><br \/>  \u0411\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u2014 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u0440\u0430\u0432\u0435\u043d \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u043a\u0440\u0438\u0432\u043e\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0438, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u0441\u044c\u044e 0<em>x<\/em>, \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0440\u044f\u043c\u044b\u043c\u0438 <em>x = a<\/em> \u0438 <em>x = b<\/em> (\u0437\u0430\u043a\u0440\u0430\u0448\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435).<\/p>\n<p>  <\/p>\n<h3 id=\"kvadraturnye-formuly\">\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u044b<\/h3>\n<p>  <\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 (1) \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/07c\/e1c\/d8f\/07ce1cd8f895d87eef476c5c5733225a.svg\" alt=\"$I = \\int_a^b f(x)dx \\approx I_n = (b - a)\\sum_{i=0}^{n-1} w_i f(\\xi_i),~~(2)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/889\/700\/7ec\/8897007eca89140fe711eea3f97725b0.svg\" alt=\"$w_i$\" data-tex=\"inline\"><\/math> \u2014 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b, \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 1, \u0430 \u0441\u0430\u043c\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u2014 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0443\u043b\u044e \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0447\u0438\u0441\u043b\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/08d\/9fa\/efb\/08d9faefbe272bdf8fbb80773542e343.svg\" alt=\"$n$\" data-tex=\"inline\"><\/math> \u0442\u043e\u0447\u0435\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<br \/>  \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (2) \u2014 \u043e\u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b (\u0442.\u0435. \u0444\u043e\u0440\u043c\u0443\u043b \u0434\u043b\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430). \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/13e\/dad\/615\/13edad615eca58df5034229ee38c61e4.svg\" alt=\"$\\lbrace \\xi_i \\rbrace$\" data-tex=\"inline\"><\/math> \u0438 \u0432\u0435\u0441\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/889\/700\/7ec\/8897007eca89140fe711eea3f97725b0.svg\" alt=\"$w_i$\" data-tex=\"inline\"><\/math> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0443\u043c\u043c\u0430 \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"vychislitelnaya-zadacha\">\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math>, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u043e\u0442\u0440\u0435\u0437\u043a\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/356\/594\/519\/3565945194c7fa6e415c402c0bc5f884.svg\" alt=\"$[a;b]$\" data-tex=\"inline\"><\/math> (\u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u0442\u043e\u0447\u043a\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c\u044b\u0435 \u0447\u0438\u0441\u043b\u043e\u043c \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u2014 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0442\u0430\u043c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F_%D0%94%D0%B8%D1%80%D0%B8%D1%85%D0%BB%D0%B5\">\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0414\u0438\u0440\u0438\u0445\u043b\u0435<\/a>!).<br \/>  \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0451\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bde\/92a\/11b\/bde92a11b6b478d55102603e9c8250f1.svg\" alt=\"$\\int_a^b f(x)dx$\" data-tex=\"inline\"><\/math>.<br \/>  \u0420\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python 3.6.<br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9c2\/a76\/dee\/9c2a76deefddf9f886812dbde91ff405.svg\" alt=\"$\\int_0^{3\/2} \\left[ 2x + \\frac{1}{\\sqrt{x + 1\/16}}\\right]dx = 17\/4$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  <\/p>\n<h3 id=\"kusochno-postoyannaya-approksimaciya\">\u041a\u0443\u0441\u043e\u0447\u043d\u043e-\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0418\u0434\u0435\u0439\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (1) &#171;\u0432 \u043b\u043e\u0431&#187;:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f0d\/bce\/b0d\/f0dbceb0d0b0251937cd5f194805305f.svg\" alt=\"$I_n = \\sum_{i=0}^{n-1} f(\\xi_i) (x_{i+1} - x_i)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0422.\u043a. \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/db3\/3be\/f7a\/db33bef7afcc606d1cdf9b9fc61c7ab4.svg\" alt=\"$\\lbrace x_i\\rbrace$\" data-tex=\"inline\"><\/math> \u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u043e\u0447\u0435\u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/13e\/dad\/615\/13edad615eca58df5034229ee38c61e4.svg\" alt=\"$\\lbrace\\xi_i\\rbrace$\" data-tex=\"inline\"><\/math> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442, \u0442\u043e \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u043b\u0438\u0441\u044c \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c, \u0430 \u0434\u043b\u044f \u0442\u043e\u0447\u0435\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b: 1) <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f97\/d3a\/aff\/f97d3aaffdedbf9255a4eacbd2e257ff.svg\" alt=\"$\\xi_i = x_i$\" data-tex=\"inline\"><\/math>; 2) <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8c0\/04e\/a71\/8c004ea7112a59a8ef1f49956065477c.svg\" alt=\"$\\xi_i = x_{i+1}$\" data-tex=\"inline\"><\/math>; 3) <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/48b\/e9b\/b7b\/48be9bb7b7b3a367afa3a6230ade1d05.svg\" alt=\"$\\xi_i = (x_i + x_{i+1}) \/ 2$\" data-tex=\"inline\"><\/math>.<br \/>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u043b\u0435\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432, \u043f\u0440\u0430\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def _rectangle_rule(func, a, b, nseg, frac):     \"\"\"\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432.\"\"\"     dx = 1.0 * (b - a) \/ nseg     sum = 0.0     xstart = a + frac * dx # 0 &lt;= frac &lt;= 1 \u0437\u0430\u0434\u0430\u0451\u0442 \u0434\u043e\u043b\u044e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043a\u0438,                             # \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f,                            # \u043e\u0442 \u043b\u0435\u0432\u043e\u0433\u043e \u043a\u0440\u0430\u044f \u043e\u0442\u0440\u0435\u0437\u043a\u0430 dx     for i in range(npoints):         sum += func(xstart + i * dx)      return sum * dx  def left_rectangle_rule(func, a, b, nseg):     \"\"\"\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043b\u0435\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432\"\"\"     return _rectangle_rule(func, a, b, nseg, 0.0)  def right_rectangle_rule(func, a, b, nseg):     \"\"\"\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u0430\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432\"\"\"     return _rectangle_rule(func, a, b, npoints, 1.0)  def midpoint_rectangle_rule(func, a, b, nseg):     \"\"\"\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439\"\"\"     return _rectangle_rule(func, a, b, nseg, 0.5)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 &#171;\u0447\u0438\u0441\u043b\u043e \u0442\u043e\u0447\u0435\u043a \u2014 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e&#187;.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ph\/s1\/hn\/phs1hnoimtbjlywmsxy14ucmlcq.png\" alt=\"image\"><\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c: <\/p>\n<p>  <\/p>\n<ol>\n<li>\u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0442\u043e\u0447\u043d\u0435\u0435, \u0447\u0435\u043c \u0441 \u043f\u0440\u0430\u0432\u043e\u0439 \u0438\u043b\u0438 \u043b\u0435\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0430\u043c\u0438<\/li>\n<li>\u041f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043f\u0430\u0434\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0443 \u0434\u0432\u0443\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445<\/li>\n<li>\u041f\u0440\u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u043b\u043a\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0442\u044c<br \/>  \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u043f\u0443\u043d\u043a\u0442\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0438\u043c\u0435\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0442.\u0435. <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a02\/805\/1ce\/a028051cea728686c0f147bd33696fc7.svg\" alt=\"$|I_n - I| = O( 1\/n^2)$\" data-tex=\"inline\"><\/math>, \u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u0440\u0430\u0432\u044b\u0445 \u0438 \u043b\u0435\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u2014 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u0442.\u0435. <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/349\/a01\/c8e\/349a01c8efa39540101a27c47ddf880a.svg\" alt=\"$|I_n - I| = O(1\/n)$\" data-tex=\"inline\"><\/math>.<br \/>  \u0412\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0435 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043b\u044c\u0447\u0435\u043d\u0438\u0438 \u0448\u0430\u0433\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445. \u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0440\u0430\u0441\u0442\u0451\u0442 \u043a\u0430\u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/349\/a01\/c8e\/349a01c8efa39540101a27c47ddf880a.svg\" alt=\"$|I_n - I| = O(1\/n)$\" data-tex=\"inline\"><\/math>, \u0447\u0442\u043e \u043d\u0435 \u0434\u0430\u0451\u0442 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<br \/>  <strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441 \u043f\u0440\u0430\u0432\u043e\u0439 \u0438 \u043b\u0435\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u0437\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0451\u0442 \u0441 \u0438\u0437\u043c\u0435\u043b\u044c\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u043c\u044b\u0441\u043b \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 \u0435\u043c\u0443 \u0448\u0430\u043d\u0441\u044b \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 (\u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435).<\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"kusochno-lineynaya-approksimaciya\">\u041a\u0443\u0441\u043e\u0447\u043d\u043e-\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043f\u043e\u0434\u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37d\/e21\/642\/37de21642ee2b2175fae43a91c4337c8.svg\" alt=\"$I_n = \\sum_{i=0}^{n-1} \\frac{f(x_i) + f(x_{i+1})}{2}(x_{i+1} - x_i)~~(3)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bo\/u_\/kq\/bou_kqhspiicqeppteokzj-bivc.png\" alt=\"image\"><br \/>  \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0434\u043b\u044f <em>n<\/em>=1 \u0438 <em>n<\/em>=2.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u0438 \u0434\u043b\u0438\u043d\u044b \u0432\u0441\u0435\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u043d\u044b, \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a8b\/aa3\/c48\/a8baa3c48234c60ca5e8e3591655b553.svg\" alt=\"$I_n = h\\left(\\frac{f(a) + f(b)}{2} + \\sum_{i=1}^{n-1} f(a + ih)\\right),~h=\\frac{b-a}{n}~~(3a)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def trapezoid_rule(func, a, b, nseg):     \"\"\"\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439        nseg - \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f [a;b]\"\"\"     dx = 1.0 * (b - a) \/ nseg     sum = 0.5 * (func(a) + func(b))     for i in range(1, nseg):         sum += func(a + i * dx)      return sum * dx<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0432 \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0442 \u0447\u0438\u0441\u043b\u0430 \u0442\u043e\u0447\u0435\u043a \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0430\u0451\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 (\u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zu\/j_\/zj\/zuj_zjj9ey9nmiiymayupp0ikxg.png\" alt=\"image\"><\/p>\n<p>  <\/p>\n<h3 id=\"kontrol-tochnosti-vychisleniya\">\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0447\u0438\u0441\u043b\u0430 \u0442\u043e\u0447\u0435\u043a \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043d\u0435 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, \u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c\u044e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043d\u0430\u043f\u0435\u0440\u0451\u0434, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0448\u0430\u0433 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u043b\u0430\u0441\u044c. \u041d\u043e \u0442\u0430\u043a \u0440\u0435\u0434\u043a\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 (\u0438 \u0432\u043e\u043e\u0431\u0449\u0435, \u043d\u0435 \u043f\u0440\u043e\u0449\u0435 \u043b\u0438 \u043f\u0440\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043d\u0430\u043f\u0435\u0440\u0451\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043f\u0440\u043e\u0442\u0430\u0431\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0435\u0440\u0451\u0434?), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0448\u0430\u0433\u0430 \u043f\u043e\u0434 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c.<br \/>  \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c? \u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u2014 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D0%BE_%D0%A0%D1%83%D0%BD%D0%B3%D0%B5\">\u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0420\u0443\u043d\u0433\u0435<\/a> \u2014 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u043e\u0432, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043f\u043e <em>n<\/em> \u0438 2<em>n<\/em> \u0442\u043e\u0447\u043a\u0430\u043c, \u0434\u0430\u0451\u0442 \u043e\u0446\u0435\u043d\u043a\u0443 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438: <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e5e\/46e\/e83\/e5e46ee83bf4622b45f426d90ea21c04.svg\" alt=\"$\\Delta_{2n} \\approx |I_{2n} - I_n|$\" data-tex=\"inline\"><\/math>. \u041c\u0435\u0442\u043e\u0434 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0434\u043b\u044f \u0443\u0434\u0432\u043e\u0435\u043d\u0438\u044f \u043c\u0435\u043b\u043a\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, \u0447\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u041f\u0440\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0434\u043b\u044f \u0443\u0434\u0432\u043e\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u0442\u043e\u0447\u0435\u043a \u043d\u0443\u0436\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0430\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, \u0442.\u0435. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0427\u0435\u043c \u0435\u0449\u0451 \u0445\u043e\u0440\u043e\u0448 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0446\u0430\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u0430. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043d\u0430 \u043a\u0440\u0430\u044f\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, sin<em>x<\/em>\/<em>x<\/em> \u0438\u043b\u0438 <em>x<\/em><sup>-1\/2<\/sup> \u043e\u0442 0 \u0434\u043e 1). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0434\u0430\u043b\u0435\u0435 \u043c\u0435\u0442\u043e\u0434 \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0438 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432. \u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043b\u0438\u0448\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0438 \u0448\u0430\u0433\u0430 \u0432\u0434\u0432\u043e\u0435 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0436\u043d\u043e <em>\u0443\u0442\u0440\u043e\u0438\u0442\u044c<\/em> \u0447\u0438\u0441\u043b\u043e \u0442\u043e\u0447\u0435\u043a, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e. \u0424\u043e\u0440\u043c\u0443\u043b\u044b \u0434\u043b\u044f \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0448\u0430\u0433\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def trapezoid_rule(func, a, b, rtol = 1e-8, nseg0 = 1):     \"\"\"\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439        rtol - \u0436\u0435\u043b\u0430\u0435\u043c\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439        nseg0 - \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f\"\"\"     nseg = nseg0     old_ans = 0.0     dx = 1.0 * (b - a) \/ nseg     ans = 0.5 * (func(a) + func(b))     for i in range(1, nseg):         ans += func(a + i * dx)      ans *= dx     err_est = max(1, abs(ans))     while (err_est &gt; abs(rtol * ans)):         old_ans = ans         ans = 0.5 * (ans + midpoint_rectangle_rule(func, a, b, nseg)) # \u043d\u043e\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430                                                                       # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432         nseg *= 2         err_est = abs(ans - old_ans)      return ans<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u0442\u0430\u043a\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0437 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435, \u0438 \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<br \/>  \u041d\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0438 \u043f\u0440\u0438 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438? \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0442\u043e\u0447\u043d\u0435\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0442\u043a\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"kusochno-parabolicheskaya-approksimaciya\">\u041a\u0443\u0441\u043e\u0447\u043d\u043e-\u043f\u0430\u0440\u0430\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043f\u0430\u0440\u0430\u0431\u043e\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0447\u0451\u0442\u043d\u044b\u043c, \u0442\u043e\u0433\u0434\u0430 \u043f\u0430\u0440\u0430\u0431\u043e\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u043e\u0447\u0435\u043a \u0441 \u0430\u0431\u0441\u0446\u0438\u0441\u0441\u0430\u043c\u0438 {(<em>x<\/em><sub>0<\/sub>=<em>a<\/em>, <em>x<\/em><sub>1<\/sub>, <em>x<\/em><sub>2<\/sub>), (<em>x<\/em><sub>2<\/sub>, <em>x<\/em><sub>3<\/sub>, <em>x<\/em><sub>4<\/sub>), &#8230;, (<em>x<\/em><sub><em>n<\/em>-2<\/sub>, <em>x<\/em><sub><em>n<\/em>-1<\/sub>, <em>x<sub>n<\/sub><\/em>=<em>b<\/em>)}.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ko\/rw\/ll\/korwllkbzphjpl_uvs10zpfnx6u.png\"><br \/>  \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043a\u0443\u0441\u043e\u0447\u043d\u043e-\u043f\u0430\u0440\u0430\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0430 3 \u0438 5 \u0442\u043e\u0447\u043a\u0430\u0445 (<em>n<\/em>=2 \u0438 <em>n<\/em>=3).<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 [<em>x<sub>k<\/sub><\/em>;<em>x<\/em><sub><em>k<\/em>+2<\/sub>] \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u043e\u043c \u043e\u0442 \u043f\u0430\u0440\u0430\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u043e\u0442\u0440\u0435\u0437\u043a\u0435 \u0438 \u0441\u0447\u0438\u0442\u0430\u044f \u0442\u043e\u0447\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 (<em>x<\/em><sub><em>k<\/em>+1<\/sub>=<em>x<sub>k<\/sub><\/em>+<em>h<\/em>), \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D0%BE%D1%80%D0%BC%D1%83%D0%BB%D0%B0_%D0%A1%D0%B8%D0%BC%D0%BF%D1%81%D0%BE%D0%BD%D0%B0\">\u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430<\/a>:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/691\/6fb\/31e\/6916fb31ea5950358efc7bf26320721b.svg\" alt=\"$I_{Simps, n} = \\sum_{i=0}^{n\/2-1}\\frac{h}{3}[f(x_{2i})+4f(x_{2i+1})+f(x_{2i + 2})] = \\frac{h}{3}[f(a)+4f(a+h)+2f(a+2h) + ... +4f(b-h) + f(b)]~~(4)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u0444\u043e\u0440\u043c\u0443\u043b\u044b (4) \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f &#171;\u043d\u0430\u0438\u0432\u043d\u0430\u044f&#187; \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def simpson_rule(func, a, b, nseg):     \"\"\"\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439        nseg - \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f [a;b]\"\"\"     if nseg%2 = 1:         nseg += 1     dx = 1.0 * (b - a) \/ nseg     sum = (func(a) + 4 * func(a + dx) + func(b))     for i in range(1, nseg \/ 2):         sum += 2 * func(a + (2 * i) * dx) + 4 * func(a + (2 * i + 1) * dx)      return sum * dx \/ 3<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u0441 \u0448\u0430\u0433\u0430\u043c\u0438 <em>h<\/em> \u0438 <em>h<\/em>\/2 \u2014 \u043d\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430, \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u0441 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c, \u0445\u043e\u0442\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u0442\u043e\u0447\u043a\u0430\u0445, \u0447\u0442\u043e \u0438 \u0440\u0430\u043d\u044c\u0448\u0435.<br \/>  \u0411\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0442\u0440\u0430\u0442\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0445\u0438\u0442\u0440\u043e\u0443\u043c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0432\u0448\u0438\u0441\u044c \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438. \u042f\u0441\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u043f\u043e \u0442\u0440\u0451\u043c \u0442\u043e\u0447\u043a\u0430\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/320\/a5d\/d3c\/320a5dd3ce1a1c1b9dc408bf62d28e14.svg\" alt=\"$(a, f_0),~(a+h, f_1),~(a+2h, f_2)$\" data-tex=\"inline\"><\/math>:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f43\/2e9\/193\/f432e91933ac4c8430a94c22b33e0b0b.svg\" alt=\"$I_{Simps,2} = \\frac{h}{3}(f_0 + 4f_1 + f_2) = \\frac{4}{3}h\\left(\\frac{f_0 + f_1}{2} + \\frac{f_1 + f_2}{2}\\right) - \\frac{1}{3}\\cdot2h\\frac{f_0 + f_2}{2} = \\frac{4I_{trap,2} - I_{trap,1}}{3}$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u0430 \u0432\u0434\u0432\u043e\u0435 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439, \u043c\u0435\u0442\u043e\u0434 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a&#8230;<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Quadrature:     \"\"\"\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b\"\"\"     __sum = 0.0     __nseg = 1  # \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f     __ncalls = 0 # \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438      def __restart(func, x0, x1, nseg0, reset_calls = True):         \"\"\"\u041e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432.            \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438\"\"\"         if reset_calls:             Quadrature.__ncalls = 0         Quadrature.__nseg = nseg0         # \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0443\u043c\u043c\u044b \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0441 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f nseg0         Quadrature.__sum = 0.5 * (func(x0) + func(x1))         dx = 1.0 * (x1 - x0) \/ nseg0         for i in range(1, nseg0):             Quadrature.__sum += func(x0 + i * dx)          Quadrature.__ncalls += 1 + nseg0         return Quadrature.__sum * dx      def __double_nseg(func, x0, x1):         \"\"\"\u0412\u0434\u0432\u043e\u0435 \u0438\u0437\u043c\u0435\u043b\u044c\u0447\u0430\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435.            \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438\"\"\"         nseg = Quadrature.__nseg         dx = (x1 - x0) \/ nseg         x = x0 + 0.5 * dx         i = 0         AddedSum = 0.0         for i in range(nseg):             AddedSum += func(x + i * dx)          Quadrature.__sum += AddedSum         Quadrature.__nseg *= 2         Quadrature.__ncalls += nseg         return Quadrature.__sum * 0.5 * dx      def trapezoid(func, x0, x1, rtol = 1e-10, nseg0 = 1):         \"\"\"\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.            rtol - \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c,            nseg0 - \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f\"\"\"         ans = Quadrature.__restart(func, x0, x1, nseg0)         old_ans = 0.0         err_est = max(1, abs(ans))         while (err_est &gt; abs(rtol * ans)):             old_ans = ans             ans = Quadrature.__double_nseg(func, x0, x1)             err_est = abs(old_ans - ans)          print(\"Total function calls: \" + str(Quadrature.__ncalls))         return ans      def simpson(func, x0, x1, rtol = 1.0e-10, nseg0 = 1):         \"\"\"\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0430\u0440\u0430\u0431\u043e\u043b \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.            rtol - \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c,            nseg0 - \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f\"\"\"         old_trapez_sum = Quadrature.__restart(func, x0, x1, nseg0)         new_trapez_sum = Quadrature.__double_nseg(func, x0, x1)         ans = (4 * new_trapez_sum - old_trapez_sum) \/ 3         old_ans = 0.0         err_est = max(1, abs(ans))         while (err_est &gt; abs(rtol * ans)):             old_ans = ans             old_trapez_sum = new_trapez_sum             new_trapez_sum = Quadrature.__double_nseg(func, x0, x1)             ans = (4 * new_trapez_sum - old_trapez_sum) \/ 3             err_est = abs(old_ans - ans)          print(\"Total function calls: \" + str(Quadrature.__ncalls))         return ans<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0438 \u043f\u0430\u0440\u0430\u0431\u043e\u043b:<\/p>\n<p>  <\/p>\n<pre><code>&gt;&gt;&gt; import math &gt;&gt;&gt; Quadrature.trapezoid(lambda x: 2 * x + 1 \/ math.sqrt(x + 1 \/ 16), 0, 1.5, rtol=1e-9) Total function calls: 65537 4.250000001385811 &gt;&gt;&gt; Quadrature.simpson(lambda x: 2 * x + 1 \/ math.sqrt(x + 1 \/ 16), 0, 1.5, rtol=1e-9) Total function calls: 2049 4.2500000000490985<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043e\u0431\u043e\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u0442\u0432\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0442\u044c \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u2014 \u043c\u0435\u0442\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0432 32 \u0440\u0430\u0437\u0430!<br \/>  \u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0432 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442 \u0447\u0438\u0441\u043b\u0430 \u0448\u0430\u0433\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430 \u0440\u0430\u0432\u0435\u043d \u0447\u0435\u0442\u044b\u0440\u0451\u043c, \u0442.\u0435. \u043e\u0448\u0438\u0431\u043a\u0430 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/229\/44a\/33d\/22944a33d464e5a15e07a1d5c2a5a470.svg\" alt=\"$|I_{Simps, n} - I| = O(1\/n^4)$\" data-tex=\"inline\"><\/math> (\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044b \u043e\u0442 \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043d\u043e\u0433\u043e\u0447\u043b\u0435\u043d\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0447\u0451\u0442\u043d\u043e\u043c <em>n<\/em>&gt;0!).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4w\/-8\/jk\/4w-8jkj9y4wc1g9wnn9ynlfdxsk.png\" alt=\"image\"><br \/>  \u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u043e\u0441\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"chto-dalshe\">\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u2014 \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0447\u043b\u0435\u043d\u0430\u043c\u0438 \u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438, \u0442\u043e \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043e\u0442 \u044d\u0442\u0438\u0445 \u043c\u043d\u043e\u0433\u043e\u0447\u043b\u0435\u043d\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0451 \u0442\u043e\u0447\u043d\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Newton%E2%80%93Cotes_formulas\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u041d\u044c\u044e\u0442\u043e\u043d\u0430-\u041a\u043e\u0442\u0435\u0441\u0430<\/a>. \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e 8 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u043d\u043e \u0432\u044b\u0448\u0435 \u0441\u0440\u0435\u0434\u0438 \u0432\u0435\u0441\u043e\u0432\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 <em>w<sub>i<\/sub><\/em> \u0432 (2) \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0447\u043b\u0435\u043d\u044b, \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445 \u0442\u0435\u0440\u044f\u044e\u0442 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c.<br \/>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0451\u043c. \u041e\u0448\u0438\u0431\u043a\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0440\u044f\u0434\u0430 \u043f\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u044f\u043c \u0448\u0430\u0433\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <em>h<\/em>. \u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 (\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439!) \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0451 \u044d\u0442\u043e\u0442 \u0440\u044f\u0434 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0447\u0451\u0442\u043d\u044b\u0445 \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c87\/f46\/420\/c87f4642027d6f65916d3e10639c6269.svg\" alt=\"$I_{trap,n}[f, a, b] = \\int_a^b f(x)dx + C_2h^2 + C_4h^4 + C_6h^6 + ...,~h = \\frac{b-a}{n}~~~(5)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0439 \u043a \u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Richardson_extrapolation\">\u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u0420\u0438\u0447\u0430\u0440\u0434\u0441\u043e\u043d\u0430<\/a>: \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0442\u044c \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043d\u043e\u0433\u043e\u0447\u043b\u0435\u043d\u043e\u043c, \u043f\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/475\/9be\/53e\/4759be53e8bf493cf222db4cdf9ede21.svg\" alt=\"$I(h)$\" data-tex=\"inline\"><\/math> \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 <em>h<\/em>=0 \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435 \u043a \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430.<br \/>  \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0447\u0451\u0442\u043d\u044b\u043c \u0441\u0442\u0435\u043f\u0435\u043d\u044f\u043c \u0448\u0430\u0433\u0430 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u043a\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0441\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438, \u0442.\u043a. \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 2<em>n<\/em> \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e <em>n<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439.<br \/>  \u0415\u0441\u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u0438 <em>h<\/em>, \u0438\u043c\u0435\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0440\u043e\u0431\u0438\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0432\u0434\u0432\u043e\u0435, \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0434\u043b\u044f \u0448\u0430\u0433\u043e\u0432 <em>h<\/em> \u0438 <em>h<\/em>\/2.<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/258\/7af\/d84\/2587afd8404573782511089c5a1f03f5.svg\" alt=\"$I_{trap,n} - I \\approx C_2h^2;~I_{trap,2n} - I \\approx C_2\\left(\\frac{h}{2}\\right)^2$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041b\u0435\u0433\u043a\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u0448\u0435\u0433\u043e \u0447\u043b\u0435\u043d\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u0441\u0442 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/829\/46f\/d0f\/82946fd0f3de27b4285b5e70fff83bb2.svg\" alt=\"$I = I_{trap,2n} - C_2\\left(\\frac{h}{2}\\right)^2 + O(h^4) \\approx I_{trap,2n} - \\frac{I_{trap,2n}-I_{trap,n}}{1-2^2} = I_{Simps,2n}$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/00b\/9ac\/c64\/00b9acc6496c3c22615419e4aea22cb1.svg\" alt=\"$I_{Simps,2n} - I \\approx C_4\\left(\\frac{h}{2}\\right)^4;~I_{Simps,n} - I \\approx C_4h^4$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fd0\/738\/540\/fd073854076b5d7334e80d241b6c93d7.svg\" alt=\"$I = I_{Simps,2n} - C_4\\left(\\frac{h}{2}\\right)^4 + O(h^6) \\approx I_{Simps,2n} - \\frac{I_{Simps,2n}-I_{Simps,n}}{1-2^4}$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c, \u0432\u044b\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430:<\/p>\n<p>  <\/p>\n<table>\n<thead>\n<tr>\n<th>2 \u043f\u043e\u0440\u044f\u0434\u043e\u043a<\/th>\n<th>4 \u043f\u043e\u0440\u044f\u0434\u043e\u043a<\/th>\n<th>6 \u043f\u043e\u0440\u044f\u0434\u043e\u043a<\/th>\n<th>&#8230;<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><em>I<\/em><sub>0,0<\/sub><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><em>I<\/em><sub>1,0<\/sub><\/td>\n<td><em>I<\/em><sub>1,1<\/sub><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><em>I<\/em><sub>2,0<\/sub><\/td>\n<td><em>I<\/em><sub>2,1<\/sub><\/td>\n<td><em>I<\/em><sub>2,2<\/sub><\/td>\n<\/tr>\n<tr>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u0441\u0442\u043e\u044f\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044b, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u043d\u0438\u0437 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0434\u0432\u043e\u0435 \u043c\u0435\u043b\u044c\u0447\u0435, \u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 \u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432\u043f\u0440\u0430\u0432\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 (\u0442.\u0435. \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044b \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430 \u0438 \u0442.\u0434.).<br \/>  \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f (5), \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u043c \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435\u043c:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b12\/b46\/757\/b12b467577c1d8ea694ddcc5069a94de.svg\" alt=\"$I_{i,j} = I_{i,j-1} - \\frac{I_{i,j-1}-I_{i-1,j-1}}{1-\\left(\\frac{h_{i-j}}{h_i}\\right)^2} = I_{i,j-1} - \\frac{I_{i,j-1}-I_{i-1,j-1}}{1-2^{2j}}~~~(6)$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0443\u043b \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0442.\u0435.<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/140\/2e4\/e0a\/1402e4e0a0d138d9ec7d03a35a6f2fde.svg\" alt=\"$\\Delta_{i,j} \\approx I_{i,j} - I_{i,j-1}$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0420\u0438\u0447\u0430\u0440\u0434\u0441\u043e\u043d\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Romberg%27s_method\">\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430<\/a>. \u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0435 \u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441 Quadrature<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">class Quadrature:     \"\"\"\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b\"\"\"     __sum = 0.0     __nseg = 1  # \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f     __ncalls = 0 # \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438      def __restart(func, x0, x1, nseg0, reset_calls = True):         \"\"\"\u041e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432.            \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438\"\"\"         if reset_calls:             Quadrature.__ncalls = 0         Quadrature.__nseg = nseg0         # \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0443\u043c\u043c\u044b \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0441 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c \u043d\u0430 nseg0 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432         Quadrature.__sum = 0.5 * (func(x0) + func(x1))         dx = 1.0 * (x1 - x0) \/ nseg0         for i in range(1, nseg0):             Quadrature.__sum += func(x0 + i * dx)          Quadrature.__ncalls += 1 + nseg0         return Quadrature.__sum * dx      def __double_nseg(func, x0, x1):         \"\"\"\u0412\u0434\u0432\u043e\u0435 \u0438\u0437\u043c\u0435\u043b\u044c\u0447\u0430\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435.            \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438\"\"\"         nseg = Quadrature.__nseg         dx = (x1 - x0) \/ nseg         x = x0 + 0.5 * dx         i = 0         AddedSum = 0.0         for i in range(nseg):             AddedSum += func(x + i * dx)          Quadrature.__sum += AddedSum         Quadrature.__nseg *= 2         Quadrature.__ncalls += nseg         return Quadrature.__sum * 0.5 * dx      def romberg(func, x0, x1, rtol = 1e-10, nseg0 = 1, maxcol = 5, reset_calls = True):         \"\"\"\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430            nseg0 - \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f            maxcol - \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\"\"\"         # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b         Itable = [[Quadrature.__restart(func, x0, x1, nseg0, reset_calls)]]         i = 0         maxcol = max(0, maxcol)         ans = Itable[i][i]         error_est = max(1, abs(ans))         while (error_est &gt; abs(rtol * ans)):             old_ans = ans             i += 1             d = 4.0             ans_col = min(i, maxcol)             Itable.append([Quadrature.__double_nseg(func, x0, x1)] * (ans_col + 1))             for j in range(0, ans_col):                 diff = Itable[i][j] - Itable[i - 1][j]                 Itable[i][j + 1] = Itable[i][j] + diff \/ (d - 1.0)                 d *= 4.0              ans = Itable[i][ans_col]             if (maxcol &lt;= 1): # \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0438 \u043f\u0430\u0440\u0430\u0431\u043e\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e                 error_est = abs(ans - Itable[i - 1][-1])             elif (i &gt; maxcol):                 error_est = abs(ans - Itable[i][min(i - maxcol - 1, maxcol - 1)])             else:                 error_est = abs(ans - Itable[i - 1][i - 1])          print(\"Total function calls: \" + str(Quadrature.__ncalls))         return ans<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code>&gt;&gt;&gt; Quadrature.romberg(lambda x: 2 * x + 1 \/ math.sqrt(x + 1\/16), 0, 1.5, rtol=1e-9, maxcol = 0) # \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0438 Total function calls: 65537 4.250000001385811 &gt;&gt;&gt; Quadrature.romberg(lambda x: 2 * x + 1 \/ math.sqrt(x + 1\/16), 0, 1.5, rtol=1e-9, maxcol = 1) # \u043f\u0430\u0440\u0430\u0431\u043e\u043b\u044b Total function calls: 2049 4.2500000000490985 &gt;&gt;&gt; Quadrature.romberg(lambda x: 2 * x + 1 \/ math.sqrt(x + 1\/16), 0, 1.5, rtol=1e-9, maxcol = 4) Total function calls: 257 4.250000001644076<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e, \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0430\u0440\u0430\u0431\u043e\u043b, \u0447\u0438\u0441\u043b\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043d\u0438\u0437\u0438\u043b\u043e\u0441\u044c \u0435\u0449\u0451 \u0432 8 \u0440\u0430\u0437. \u041f\u0440\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0435\u0449\u0451 \u0437\u0430\u043c\u0435\u0442\u043d\u0435\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pw\/d8\/3r\/pwd83rerz_10ju9x5jia4kpt9bm.png\" alt=\"image\"><\/p>\n<p>  <\/p>\n<h3 id=\"nekotorye-zamechaniya\">\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p><strong>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 1.<\/strong> \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430. \u0423\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b (\u0445\u043e\u0442\u044f \u043f\u0440\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u044d\u0442\u043e \u0442\u043e\u0436\u0435), \u043d\u043e \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0422\u0430\u043a, \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 5\u00d710<sup>-15<\/sup>, \u043c\u0435\u0442\u043e\u0434 \u043f\u0430\u0440\u0430\u0431\u043e\u043b \u2014 \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 2\u00d710<sup>-16<\/sup>(\u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u043c \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0432 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438), \u0430 \u043c\u0435\u0442\u043e\u0434 \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 (\u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432 \u043c\u043b\u0430\u0434\u0448\u0435\u043c \u0431\u0438\u0442\u0435). \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430.<br \/>  <strong>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 2.<\/strong> \u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u0438\u043c\u0435\u0435\u0442 \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0441\u043b\u0443\u0447\u0430\u044f\u043c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0431\u043b\u0438\u0437\u043a\u0430 \u043a \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<br \/>  <strong>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 3.<\/strong> \u0425\u043e\u0442\u044f \u043c\u0435\u0442\u043e\u0434 \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430 \u0434\u043b\u044f \u0440\u044f\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043d \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443 \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445 \u0432\u044b\u0441\u043e\u043a\u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u0438\u0437\u043b\u043e\u043c\u0430\u043c\u0438 \u0438\u043b\u0438 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u043c\u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0445\u0443\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c <em>f<\/em>(<em>x<\/em>)=|<em>x<\/em>|:<\/p>\n<p>  <\/p>\n<pre><code>&gt;&gt;&gt; Quadrature.trapezoid(abs, -1, 3, rtol=1e-5) Total function calls: 9 5.0 &gt;&gt;&gt; Quadrature.simpson(abs, -1, 3, rtol=1e-5) Total function calls: 17 5.0 &gt;&gt;&gt; Quadrature.romberg(abs, -1, 3, rtol=1e-5, maxcol = 2) Total function calls: 17 5.0 &gt;&gt;&gt; Quadrature.romberg(abs, -1, 3, rtol=1e-5, maxcol = 3) Total function calls: 33 5.0 &gt;&gt;&gt; Quadrature.romberg(abs, -1, 3, rtol=1e-5, maxcol = 4) Total function calls: 33 5.000001383269357<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 4.<\/strong> \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043c \u0432\u044b\u0448\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043b\u0443\u0447\u0448\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 4-6. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u044d\u0442\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 (6). \u0412\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <em>j<\/em>-1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u043f\u043e\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 4<sup><em>j<\/em><\/sup>. \u0422.\u043a. \u0432 <em>j<\/em>-1-\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 2<em>j<\/em>, \u0442\u043e \u0441\u0430\u043c\u0430 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a (1\/<em>n<sub>i<\/sub><\/em>)<sup>2<em>j<\/em><\/sup>\u00a0~\u00a04<sup>&#8212;<em>ij<\/em><\/sup>. C \u0443\u0447\u0451\u0442\u043e\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f ~4<sup>-(<em>i<\/em>+1)<em>j<\/em><\/sup>\u00a0~\u00a04<sup>&#8212;<em>j<\/em><sup>2<\/sup><\/sup>. \u0422.\u0435. \u043f\u0440\u0438 <em>j<\/em>~7 \u0432\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0432 (6) \u0442\u0435\u0440\u044f\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432 \u043f\u0440\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u0438 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u044e \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f.<br \/>  <strong>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 5.<\/strong> \u0416\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/eec\/549\/9b2\/eec5499b2c2e4bee7d975b4248917873.svg\" alt=\"$\\int_0^1\\sqrt{x}\\sin{x}dx$\" data-tex=\"inline\"><\/math> \u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0435\u043c\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c6d\/c6d\/c74\/c6dc6dc746b295a564bd1a595e939651.svg\" alt=\"$\\int_0^1 2t^2\\sin{t^2}dt$\" data-tex=\"inline\"><\/math>. \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u043f\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0440\u0430\u0437\u043d\u0438\u0446\u0443.<\/p>\n<p>  <\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u0435. \u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0431\u0430\u0437\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0430\u043f\u0435\u0446\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0420\u043e\u043c\u0431\u0435\u0440\u0433\u0430, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0441\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041c\u0435\u0442\u043e\u0434 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f &#171;\u043e\u0431\u044b\u0447\u043d\u044b\u0445&#187; \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442.\u0435. \u0441\u043b\u0430\u0431\u043e \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043a\u0440\u0430\u044f\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u0430 (\u0441\u043c. \u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 5), \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u043e\u0441\u0446\u0438\u043b\u043b\u044f\u0446\u0438\u0439 \u0438 \u0442.\u0434.<br \/>  \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u043d\u0438\u0433\u0430\u0445 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b (\u0432 [3] \u2014 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 C++).<\/p>\n<p>  <\/p>\n<h3 id=\"literatura\">\u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<\/h3>\n<p>  <\/p>\n<ol>\n<li><em>\u0410.\u0410. \u0421\u0430\u043c\u0430\u0440\u0441\u043a\u0438\u0439, \u0410.\u0412. \u0413\u0443\u043b\u0438\u043d.<\/em> \u0427\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u041c.: \u041d\u0430\u0443\u043a\u0430. 1989.<\/li>\n<li><em>J. Stoer, R. Bulirsch.<\/em> Introduction to Numerical Analysis: Second Edition. Springer-Verlag New York. 1993.<\/li>\n<li><em>W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P. Flannery.<\/em> Numerical Recipes: Third Edition. Cambridge University Press. 2007.<\/li>\n<\/ol>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/420867\/\"> https:\/\/habr.com\/post\/420867\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420867\/\" class=\"post__text post__text-html js-mediator-article\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/u9\/v3\/cz\/u9v3czzjh1wakdvjgj5u64tyxhy.gif\" alt=\"image\"><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435, \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"https:\/\/www.gnu.org\/software\/gsl\/\">GNU Scientific Library<\/a> \u0434\u043b\u044f C, <a href=\"https:\/\/www.scipy.org\/\">SciPy<\/a> \u0434\u043b\u044f Python \u0438 \u0434\u0440\u0443\u0433\u0438\u0445. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187;, \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0447\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-288445","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288445"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288445\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}