2020年1月21日火曜日

学習環境

解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第8章(積分の計算)、8.2(定積分の計算)、問題10の解答を求めてみる。


  1. 関数 f の原始関数を F とおくと、

    d dx 0 x f t x - t 0 dt = d dx 0 x f t dt = f x g x = 0 x f t x - t n dt = F t x - t n 0 x - 0 x F t 1 n x - t n - 1 dt = - F 0 x n + n 0 x F t x - t n - 1 dt d n + 1 dx n + 1 g x = d dx d n dx n g x = d dx - F 0 + n d n dx n 0 x F t x - t n - 1 dt = d dx n n - 1 ! F x = n ! f x

    よって、 帰納法によりすべての自然数数 n に対に成り立つ。

    (証明終)

コード

#!/usr/bin/env python3
from unittest import TestCase, main
from sympy import pprint, symbols, Integral, factorial, Derivative, plot

print('10.')

x, t = symbols('x, t')
f = x ** 2 + 3
n = symbols('n', integerr=True, positive=True)
g = Integral(f.subs({x: t}) * (x - t) ** n, (t, 0, x))


class MyTestCase(TestCase):
    def test(self):
        for n0 in range(10):
            self.assertEqual(Derivative(g.subs({n: n0}), x, n0 + 1).subs({n: n0}).doit().simplify(),
                             factorial(n0) * f)


p = plot(f,
         *[g.subs({n: n0}).doit() for n0 in range(4)],
         *[factorial(n0) * f for n0 in range(4)],
         (x, -5, 5),
         ylim=(-5, 5),
         legend=False,
         show=False)

colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

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

for o in zip(p, colors):
    pprint(o)

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

if __name__ == '__main__':
    main()

入出力結果(Zsh、PowerShell、Terminal、Jupyter(IPython))

% ./sample9.py
9.
∞              
⌠              
⎮  -a          
⎮ x  ⋅sin(x) dx
⌡              
0              

⎧     a   1                               
⎪   - ─ - ─                               
⎪     2   2     ⎛    a⎞                   
⎪2⋅4       ⋅√π⋅Γ⎜1 - ─⎟                   
⎪               ⎝    2⎠                   
⎪──────────────────────  for a > 0 ∧ a < 2
⎪        ⎛a   1⎞                          
⎪       Γ⎜─ + ─⎟                          
⎨        ⎝2   2⎠                          
⎪                                         
⎪   ∞                                     
⎪   ⌠                                     
⎪   ⎮  -a                                 
⎪   ⎮ x  ⋅sin(x) dx          otherwise    
⎪   ⌡                                     
⎪   0                                     
⎩                                         

∞          
⌠          
⎮ sin(x)   
⎮ ────── dx
⎮   √x     
⌡          
0          

√2⋅√π
─────
  2  

∞          
⌠          
⎮ sin(x)   
⎮ ────── dx
⎮   x      
⌡          
0          

π
─
2

∞          
⌠          
⎮ sin(x)   
⎮ ────── dx
⎮   3/2    
⎮  x       
⌡          
0          

√2⋅√π

∞            
⌠            
⎮ │sin(x)│   
⎮ ──────── dx
⎮   │ a│     
⎮   │x │     
⌡            
0            

∞            
⌠            
⎮ │sin(x)│   
⎮ ──────── dx
⎮   │ a│     
⎮   │x │     
⌡            
0            

(cartesian line: sin(x) for x over (0.1, 10.0), red)
(cartesian line: sqrt(x) for x over (0.1, 10.0), green)
(cartesian line: x for x over (0.1, 10.0), blue)
(cartesian line: x**(3/2) for x over (0.1, 10.0), brown)
(cartesian line: sin(x)/sqrt(x) for x over (0.1, 10.0), orange)
(cartesian line: sin(x)/x for x over (0.1, 10.0), purple)
(cartesian line: sin(x)/x**(3/2) for x over (0.1, 10.0), pink)
(cartesian line: Abs(sin(x))/Abs(sqrt(x)) for x over (0.1, 10.0), gray)
(cartesian line: Abs(sin(x))/Abs(x) for x over (0.1, 10.0), skyblue)
(cartesian line: Abs(sin(x))/Abs(x**(3/2)) for x over (0.1, 10.0), yellow)
%

0 コメント:

コメントを投稿