用Octave计算不定式极限(1)
广告
{{v.name}}
基本不定式(1) \(\frac{0}{0}\)型
计算\(\displaystyle\lim_{x \to 0} \frac{\sqrt{1+{\rm sin}2x} - \sqrt{1-{\rm sin}2x}}{ {\rm ln}(1+x)}\)
程序代码如下
function [text_result, numeric_result] = func7(x_value)
pkg load symbolic;
x = sym('x');
unit_1 = sqrt(1+sin(2*x));
unit_2 = sqrt(1-sin(2*x));
unit_3 = log(1+x);
question = (unit_1 - unit_2) / unit_3;
lim = limit(question, x, x_value);
text_result = ["\n", disp(lim)];
numeric_result = eval(lim);
endfunction
令\(x \to 0\),计算结果如下
>> [text_result, numeric_result] = func7(0)
text_result =
2
numeric_result = 2