用Octave计算不定式极限(5)
广告
{{v.name}}
其他不定式(2) \( \infty - \infty \)型
计算\( \displaystyle\lim_{x \to 0 } \left ( \frac{1}{ { \rm sin^2} x} - \frac{1}{ x^2} \right ) \)
程序代码如下
function [text_result, numeric_result] = func11(x_value)
pkg load symbolic;
x = sym('x');
unit_1 = 1 / sin(x);
unit_2 = 1 / x;
question = unit_1^2 - unit_2^2;
lim = limit(question, x, x_value);
text_result = ["\n", disp(lim)];
numeric_result = eval(lim);
endfunction
令\(x \to 0 \),计算结果如下
>> [text_result, numeric_result] = func11(0)
text_result =
1/3
numeric_result = 0.3333