일반수학및실습2-8.4절

1144 days 전, jhlee2chn 작성

f(x)=1/x^2 plot(f(x), (x, -2, 1), ymax=5, fill=True) 
       
integral(f(x), x, -2, 1) 
       
Traceback (click to the left of this block for traceback)
...
ValueError: Integral is divergent.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_3.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("aW50ZWdyYWwoZih4KSwgeCwgLTIsIDEp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpU5BXF9/___code___.py", line 3, in <module>
    exec compile(u'integral(f(x), x, -_sage_const_2 , _sage_const_1 )
  File "", line 1, in <module>
    
  File "/usr/local/sage-5.12/local/lib/python2.7/site-packages/sage/misc/functional.py", line 748, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 9759, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:40828)
  File "/usr/local/sage-5.12/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 692, in integrate
    return definite_integral(expression, v, a, b)
  File "function.pyx", line 789, in sage.symbolic.function.BuiltinFunction.__call__ (sage/symbolic/function.cpp:7825)
  File "function.pyx", line 430, in sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:5161)
  File "/usr/local/sage-5.12/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 173, in _eval_
    return integrator(*args)
  File "/usr/local/sage-5.12/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 21, in maxima_integrator
    result = maxima.sr_integral(expression, v, a, b)
  File "/usr/local/sage-5.12/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 740, in sr_integral
    raise ValueError, "Integral is divergent."
ValueError: Integral is divergent.

예.

f(x)=1/sqrt(4-x^2) plot(f(x), (x, 0, 2), fill=True) 
       
integral(f(x), x, 0, 2) 
       
1/2*pi
1/2*pi

예제 8.

var('x, y') F(x, y)=x^(2/3)+y^(2/3)-1 implicit_plot(F(x, y)==0, (x, 0, 1), (y, 0, 1)) # 제 1사분면만 그림 
       
Fx=diff(F(x, y), x) Fy=diff(F(x, y), y) dydx=-Fx/Fy print dydx # 도함수 
       
-y^(1/3)/x^(1/3)
-y^(1/3)/x^(1/3)
1+dydx^2 
       
y^(2/3)/x^(2/3) + 1
y^(2/3)/x^(2/3) + 1
integral(1/x^(1/3), x, 0, 1) 
       
3/2
3/2

예제 10.

f(x)=1/(x-1)^(2/3) plot(f(x), (x, 0, 3), fill=True, ymax=5) 
       
verbose 0 (2395: plot.py, generate_plot_points) WARNING: When plotting,
failed to evaluate function at 66 points.
verbose 0 (2395: plot.py, generate_plot_points) Last error message:
'negative number to a fractional power not real'
verbose 0 (2395: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 66 points.
verbose 0 (2395: plot.py, generate_plot_points) Last error message: 'negative number to a fractional power not real'
integral(f(x), x, 0, 3) 
       
3*2^(1/3) - 3*(-1)^(1/3)
3*2^(1/3) - 3*(-1)^(1/3)
(3*2^(1/3)).n(digits=5) 
       
3.7798
3.7798