用Octave求二重积分
广告
{{v.name}}
设\(D=\{(x, y)|1\leq x\leq10, {\rm ln}x\leq y\leq x^3\}\),求\(\iint_D{(x^2+y^2)}{\rm d}x{\rm d}y\).
程序代码如下
function [text_result, numeric_result] = func81()
pkg load symbolic;
x = sym('x');
y = sym('y');
result = x^2 + y^2;
result = int(result, y, log(x), x^3);
result = int(result, x, 1, 10);
text_result = ["\n", disp(result)];
numeric_result = eval(result);
endfunction
结果如下
>> [text_result, numeric_result] = func81()
text_result =
3
1060⋅log(10) 10⋅log (10) 2 1667500644
- ──────────── - ─────────── + 10⋅log (10) + ──────────
3 3 5
numeric_result = 3.3350e+08