用Octave计算不定式极限(4)
广告
{{v.name}}
其他不定式(1) \(0\cdot \infty \)型
计算\( \displaystyle\lim_{x \to -\infty } x \cdot \left ( { \rm arctan} x+ \frac{\pi}{2} \right ) \)
程序代码如下
function [text_result, numeric_result] = func10(x_value)
pkg load symbolic;
x = sym('x');
unit_1 = atan(x);
unit_2 = pi/2;
question = x * (unit_1 + unit_2);
lim = limit(question, x, x_value);
text_result = ["\n", disp(lim)];
numeric_result = eval(lim);
endfunction
令\(x \to -\infty \),计算结果如下
>> [text_result, numeric_result] = func10(-inf)
warning: passing floating-point values to sym is dangerous, see "help sym"
warning: called from
double_to_sym_heuristic at line 50 column 7
sym at line 384 column 13
plus at line 53 column 5
func10 at line 6 column 14
text_result =
-1
numeric_result = -1