Loading [MathJax]/jax/output/CommonHTML/jax.js

2019年1月20日日曜日

学習環境

解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第3部(積分)、第13章(積分の応用)、補充問題、曲線の長さの練習問題9の解答を求めてみる。


  1. 3401+(ddxlog(1-x2))2dx=3401+(-2x1-x2)2dx=340(1-x2)2+4x21-x2dx=3401+2x2+x41-x2dx=340(x2+1)21-x2dx=340x2+11-x2dx=340(21-x2-1)dx=23401(1+x)(1-x)dx-34a1+x+b1-x=(-a+b)x+(a+b)(1+x)(1-x)a+b=1-a+b=0b=12a=1223401(1+x)(1-x)dx=340(11+x+11-x)dx=[log(1+x)-log(1-x)]340=log74-log14=log7

    よって、求める曲線の長さは、

    log7-34

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Integral, Derivative, plot, sqrt, Rational
from sympy import log

x = symbols('x')

f = log(1 - x ** 2)
I = Integral(sqrt(1 + Derivative(f, x, 1) ** 2), (x, 0, Rational(3, 4)))

I1 = I.doit()
I2 = I1.doit()
for o in [I, I1, I2]:
    pprint(o)
    print()

I = Integral((x ** 2 + 1) / (1 - x ** 2), (x, 0, Rational(3, 4)))
for o in [I, I.doit()]:
    pprint(o.simplify())
    print()
p = plot((f, (x, -0.9, 0)),
         (f, (x, 0, Rational(3, 4))),
         (f, (x, Rational(3, 4), 0.9)),
         legend=True,
         show=False)
colors = ['red', 'green', 'blue']
for i, color in enumerate(colors):
    p[i].line_color = color
p.save('sample9.png')

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

iMac:曲線の長さ kamimura$ python3 sample9.py
3/4                                   
 ⌠                                    
 ⎮       __________________________   
 ⎮      ╱                    2        
 ⎮     ╱  ⎛d ⎛   ⎛   2    ⎞⎞⎞         
 ⎮    ╱   ⎜──⎝log⎝- x  + 1⎠⎠⎟  + 1  dx
 ⎮  ╲╱    ⎝dx               ⎠         
 ⌡                                    
 0                                    

3/4                            
 ⌠                             
 ⎮         _________________   
 ⎮        ╱        2           
 ⎮       ╱      4⋅x            
 ⎮      ╱   ─────────── + 1  dx
 ⎮     ╱              2        
 ⎮    ╱     ⎛   2    ⎞         
 ⎮  ╲╱      ⎝- x  + 1⎠         
 ⌡                             
 0                             

3/4                            
 ⌠                             
 ⎮         _________________   
 ⎮        ╱        2           
 ⎮       ╱      4⋅x            
 ⎮      ╱   ─────────── + 1  dx
 ⎮     ╱              2        
 ⎮    ╱     ⎛   2    ⎞         
 ⎮  ╲╱      ⎝- x  + 1⎠         
 ⌡                             
 0                             

3/4              
 ⌠               
 ⎮   ⎛ 2    ⎞    
 ⎮  -⎝x  + 1⎠    
 ⎮  ────────── dx
 ⎮     2         
 ⎮    x  - 1     
 ⌡               
 0               

-3/4 + log(7)

$

0 コメント:

コメントを投稿