2019年12月7日土曜日

学習環境

解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第7章(積分法)、7.3(不定積分、広義積分)、問題7の解答を求めてみる。



    1. x - a α f x ≥ M f x ≥ M x - a α ∫ a b f x dx ≥ M ∫ a b 1 x - a α d x α ≥ 1

      この右辺について、

      ∫ a b 1 x - a α dx = ∫ 0 b - a 1 x α dx = ∞

      よって、

      ∫ a b f = ∞

      となり、正の無限大に発散するので収をしない。

      (証明終)


    2. 0 < α ≤ 1 x α f x ≥ M f x ≥ M x α ∫ a b f x dx ≥ M ∫ a b 1 x α dx ∫ a b 1 x α d x = + ∞

      よって、 積分

      ∫ a b f x dx

      は収束しない。

      (証明終)

コード

#!/usr/bin/env python3
from unittest import TestCase, main
from sympy import pprint, symbols, summation, plot, Limit, Integral, oo

print('7.')

a = 2
b = 3
x = symbols('x')
f = x ** 2 + 1 / (x - a)
alpha = 1
g = (x - a) ** alpha * f
m = 1


class MyTestCase(TestCase):
    def test_a(self):
        If = Integral(f, (x, a, b))
        self.assertEqual(If.doit(), oo)

    def test_b(self):
        If = Integral(f, (x, a, oo))
        self.assertEqual(If.doit(), oo)


p = plot((f, (x, a + 0.1, a + 5)),
         (m, (x, a, a + 5)),
         ylim=(0, 50),
         show=False,
         legend=True)
colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

for o, color in zip(p, colors):
    o.line_color = color

p.show()
p.save('sample7.png')

if __name__ == '__main__':
    main()

入出力結果(Zsh、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))

% ./sample7.py -v
7.
test_a (__main__.MyTestCase) ... ok
test_b (__main__.MyTestCase) ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.166s

OK
%

0 コメント:

コメントを投稿