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

2019年1月28日月曜日

学習環境

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


  1. 412(2θ)2+(ddθ(2θ))2dθ=41222θ2+(-2θ2)2dθ=24121θ2+1θ4dθ=2412θ2+1θ2dθ

    いろいろと微分してみる。

    ddθθ2+1θ=1θ2(θθ2+1·θ-θ2+1)=1θ2+1-θ2+1θ2=-θ2θ2+1ddθlog(θ+θ2+1)=11+θ2ddθ(log(θ+θ2+1)-θ2+1θ)=11+θ2-1θ2+1+θ2+1θ2=θ2+1θ2

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

    2[log(θ+θ2+1)-θ2+1θ]412=2((log(4+17)-174)-(log(12+14+1)-214+1))=2(log(4+17)-174-log(12+52)+5)=25-172+2log8+2171+5

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Integral, Derivative, sqrt, cos, sin, pi
from sympy import Rational, log
from sympy.plotting import plot_parametric

theta = symbols('θ')
r = 2 / theta
x = r * cos(theta)
y = r * sin(theta)

I = Integral(sqrt(r ** 2 + Derivative(r, theta, 1) ** 2),
             (theta, Rational(1, 2), 4))

for o in [I, I.doit()]:
    pprint(o.simplify())
    print()

I = 2 * Integral(sqrt(theta ** 2 + 1) / theta ** 2, (theta, Rational(1, 2), 4))
for o in [I, I.doit()]:
    pprint(o.simplify())
    print()

for o in [I.doit(),
          2 * sqrt(5) - sqrt(17) / 2 + 2 *
          log((8 + 2 * sqrt(17)) / (1 + sqrt(5)))]:
    print(float(o))

p = plot_parametric((x, y, (theta, Rational(1, 3), Rational(1, 2))),
                    (x, y, (theta, Rational(1, 2), 4)),
                    (x, y, (theta, 4, 5)),
                    show=False)

colors = ['red', 'green', 'blue']
for i, color in enumerate(colors):
    p[i].line_color = color
p.save('sample17.png')

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

$ python3 sample17.py
 4                          
 ⌠                          
 ⎮        _______________   
 ⎮       ╱        2         
 ⎮      ╱  ⎛d ⎛2⎞⎞    4     
 ⎮     ╱   ⎜──⎜─⎟⎟  + ──  dθ
 ⎮    ╱    ⎝dθ⎝θ⎠⎠     2    
 ⎮  ╲╱                θ     
 ⌡                          
1/2                         

   4                   
   ⌠                   
   ⎮        ________   
   ⎮       ╱  2        
   ⎮      ╱  θ  + 1    
2⋅ ⎮     ╱   ──────  dθ
   ⎮    ╱       4      
   ⎮  ╲╱       θ       
   ⌡                   
  1/2                  

   4                
   ⌠                
   ⎮     ________   
   ⎮    ╱  2        
   ⎮  ╲╱  θ  + 1    
2⋅ ⎮  ─────────── dθ
   ⎮        2       
   ⎮       θ        
   ⌡                
  1/2               

  √17                                   
- ─── - 2⋅asinh(1/2) + 2⋅asinh(4) + 2⋅√5
   2                                    

5.637584586593745
5.637584586593745
$

0 コメント:

コメントを投稿