用Octave判断间断点的分类(1)
广告
{{v.name}}
(1)可去间断点
设\( f(x) = \cases{
\frac{ {\rm ln}(1+x)}{x} , & x > 0 \\
0 , & x = 0 \\
\frac{ \sqrt{1+x} - \sqrt{1-x} }{x} , & -1 ≤ x < 0
} \),讨论\( f(x) \)在\( x=0 \)处的连续性。
程序代码如下
function [text_result, numeric_result] = func15(x_value)
pkg load symbolic;
x = sym('x');
equation_1 = log(1 + x) / x;
equation_2 = 0;
equation_3 = (sqrt(1 + x) - sqrt(1 - x)) / x;
if (x_value > 0)
question = equation_1;
elseif (x_value == 0)
question = equation_2;
elseif (x_value >= -1)
question = equation_3;
else
error('Invalid input value.')
endif
lim = limit(question, x, x_value);
text_result = ["\n", disp(lim)];
numeric_result = eval(lim);
endfunction
令\(x \gt 0 ( x = 0.01)\),计算结果如下
>> [text_result, numeric_result] = func15(0.01)
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
limit at line 92 column 5
func15 at line 16 column 9
text_result =
⎛101⎞
100⋅log⎜───⎟
⎝100⎠
numeric_result = 0.9950
令\(x = 0\),计算结果如下
>> [text_result, numeric_result] = func15(0)
text_result =
0
numeric_result = 0
令\(x \lt 0 ( x = -0.01)\),计算结果如下
>> [text_result, numeric_result] = func15(-0.01)
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
limit at line 92 column 5
func15 at line 16 column 9
text_result =
-30⋅√11 + 10⋅√101
numeric_result = 1.0000
因为\( f(0+0) = f(0-0) \ne f(0) \),所以\( x=0 \)为\( f(x) \)的可去间断点