用Octave求不定积分基本公式(2)
广告
{{v.name}}
不定积分基本公式(2) \(\int{x^{a} }{\rm d}x=\frac{1}{a+1}x^{a+1}+C(a\neq -1)\)
求\(\int{x^2}{\rm d}x\).
程序代码如下
function [text_result, numeric_result] = func56()
pkg load symbolic;
x = sym('x');
f = int(x^2, x);
text_result = ["\n", disp(f)];
numeric_result = eval(f);
endfunction
结果如下
>> [text_result, numeric_result] = func56()
text_result =
3
x
──
3
numeric_result = (sym)
3
x
──
3