用Octave计算不定积分基本性质(2)
广告
{{v.name}}
不定积分基本性质(2) \(\int{kf(x)}{\rm d}x=k\int{f(x)}{\rm d}x\)
求\( f(x)=\int{ 3{\rm sin}(x)}{\rm d}x\),
\( g(x)=3\int{ {\rm sin}(x)}{\rm d}x\).
程序代码如下
function [text_result, numeric_result] = func54()
pkg load symbolic;
x = sym('x');
f = int(3 * sin(x));
g = 3 * int(sin(x));
text_result = ["\nf=", disp(f), "\ng=", disp(g)];
numeric_result = [eval(f), eval(g)];
endfunction
结果如下
>> [text_result, numeric_result] = func54()
text_result =
f= -3⋅cos(x)
g= -3⋅cos(x)
numeric_result = (sym) [-3⋅cos(x) -3⋅cos(x)] (1×2 matrix)
可见\(f(x)=g(x)\).