2017年6月28日水曜日

学習環境

解析入門〈2〉(松坂 和夫(著)、岩波書店)の第7章(積分法)、7.3(不定積分、広義積分)、問題1、2.を取り組んでみる。


    1. [ arcsin x a ] 0 a =arcsin1arcsin0 = π 2 0 = π 2

    2. [ 1 a arctan x a ] = 1 a ( π 2 ( π 2 ) ) = π a

    1. lim n k=1 n ( 0+ k( 10 ) n ) α 10 n = 0 1 x α dx = [ x α+1 α+1 ] 0 1 = 1 α+1

    2. lim n k=1 n sinπ( 0+ k( 10 ) n ) 10 n = 0 1 sinπxdx = [ 1 π cosπx ] 0 1 = 1 π ( cosπcosπ ) = 1 π ( 11 ) = 2 π

    3. lim n i=1 n 1 n+i = lim n 21 n i=1 n n n+i( 21 ) = lim n 21 n i=1 n 1 1+ i( 21 ) n = 1 2 1 x dx = [ logx ] 1 2 =log2log1 =log2

    4. lim n n i=1 i n n = lim n 10 n n i=1 0+ i(10) n = 1 0 x dx = [ 2 3 x 3 2 ] 0 1 = 2 3

    5. lim n i=1 n 1 n 2 +in = lim n 21 n i=1 n 1 1+ i( 21 ) n = 1 2 1 x dx = [ 2 x 1 2 ] 1 2 =2( 2 1 )

コード(Emacs)

Python 3

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sympy import pprint, symbols, Integral, pi, sin, sqrt

x = symbols('x')
a = symbols('a', positive=True)
fs = [(x ** a, (0, 1)),
      (sin(pi * x), (0, 1)),
      (1 / x, (1, 2)),
      (sqrt(x), (0, 1)),
      (1 / sqrt(x), (1, 2))]
for i, (f, (x1, x2)) in enumerate(fs, 1):
    g = Integral(f, (x, x1, x2))
    pprint(g)
    result = g.doit()
    pprint(result.expand())
    pprint(result.factor())
    print()

入出力結果(Terminal, IPython)

$ ./sample1.py
1      
⌠      
⎮  a   
⎮ x  dx
⌡      
0      
  1  
─────
a + 1
  1  
─────
a + 1

1            
⌠            
⎮ sin(π⋅x) dx
⌡            
0            
2
─
π
2
─
π

2     
⌠     
⎮ 1   
⎮ ─ dx
⎮ x   
⌡     
1     
log(2)
log(2)

1      
⌠      
⎮ √x dx
⌡      
0      
2/3
2/3

2      
⌠      
⎮ 1    
⎮ ── dx
⎮ √x   
⌡      
1      
-2 + 2⋅√2
2⋅(-1 + √2)

$

0 コメント:

コメントを投稿

Comments on Google+: