学習環境
- Surface Go、タイプ カバー、ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第3部(積分)、第13章(積分の応用)、補充問題、曲線の長さの練習問題19の解答を求めてみる。
π∫0√(1-cosθ)2+(ddθ(1-cosθ))2dθ=π∫0√1-2cosθ+cos2θ+sin2θdθ=π∫0√2-2cosθdθ=√2π∫0√1-cos(θ2+θ2)dθ=√2π∫0√1-(cos2(θ2)-sin2(θ2))dθ=√2π∫0√2sin2(θ2)dθ=2π∫0sin(θ2)dθ=2[-2cos(θ2)]π0=-4(cosπ2-cosθ)=-4(0-1)=4
コード
Python 3
#!/usr/bin/env python3 from sympy import pprint, symbols, Integral, Derivative, sqrt, cos, sin, pi from sympy.plotting import plot_parametric theta = symbols('θ') r = 1 - cos(theta) x = r * cos(theta) y = r * sin(theta) I = Integral(sqrt(r ** 2 + Derivative(r, theta, 1) ** 2), (theta, 0, pi)) for o in [I, I.doit()]: pprint(o.simplify()) print() I = 2 * Integral(sin(theta / 2), (theta, 0, pi)) for o in [I, I.doit()]: pprint(o.simplify()) print() p = plot_parametric((x, y, (theta, 0, pi)), (x, y, (theta, pi, 2 * pi)), show=False) colors = ['red', 'green'] for i, color in enumerate(colors): p[i].line_color = color p.save('sample19.png')
入出力結果(cmd(コマンドプロンプト)、Terminal、Jupyter(IPython))
$ python3 sample19.py π ⌠ ⎮ ____________________________________ ⎮ ╱ 2 ⎮ ╱ 2 ⎛d ⎞ ⎮ ╱ (cos(θ) - 1) + ⎜──(-cos(θ) + 1)⎟ dθ ⎮ ╲╱ ⎝dθ ⎠ ⌡ 0 π ⌠ ⎮ _______________ ⎮ ╲╱ -2⋅cos(θ) + 2 dθ ⌡ 0 π ⌠ ⎮ ⎛θ⎞ 2⋅⎮ sin⎜─⎟ dθ ⎮ ⎝2⎠ ⌡ 0 4 $
0 コメント:
コメントを投稿