Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

2017年8月9日水曜日

学習環境

数学読本〈5〉微分法の応用/積分法/積分法の応用/行列と行列式(松坂 和夫(著)、岩波書店)の第19章(細分による加法 - 積分法)、19.2(不定積分の計算)、x^n(累乗、べき乗)の不定積分、問2.を取り組んでみる。


  1. x4dx=15x5+C1x5dx=16x6+C2x6dx=17x7+C3x100dx=1101x100+C4

コード(Emacs)

Python 3

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

from sympy import pprint, symbols, Integral

print('2.')
x = symbols('x')

for n in [4, 5, 6, 100]:
    f = x ** n
    I = Integral(f, x)
    pprint(I)
    for o in [I, I.doit()]:
        pprint(o)
        print()
    print()

入出力結果(Terminal, IPython)

$ ./sample2.py
2.
⌠      
⎮  4   
⎮ x  dx
⌡      
⌠      
⎮  4   
⎮ x  dx
⌡      

 5
x 
──
5 


⌠      
⎮  5   
⎮ x  dx
⌡      
⌠      
⎮  5   
⎮ x  dx
⌡      

 6
x 
──
6 


⌠      
⎮  6   
⎮ x  dx
⌡      
⌠      
⎮  6   
⎮ x  dx
⌡      

 7
x 
──
7 


⌠        
⎮  100   
⎮ x    dx
⌡        
⌠        
⎮  100   
⎮ x    dx
⌡        

 101
x   
────
101 


$

0 コメント:

コメントを投稿