Processing math: 100%

2019年2月10日日曜日

学習環境

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


  1. θ=-π6,π6,36π,56ππr22πdθ=12cos2(3θ)dθt=3θdtdθ=3π=-π2,52π12cos2t·13dt=16(12sintcost+121dt)=112(sintcost+t)112[sintcost+t](52π)(-π2)=112·3π=π4

コード

Python 3

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

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

I = Integral(r ** 2 / 2, (theta, -pi / 6, 5 * pi / 6))
for o in [I, I.doit()]:
    pprint(o.simplify())
    print()

p = plot_parametric((x, y, (theta, -pi / 6, pi / 6)),
                    (x, y, (theta, pi / 6, 3 * pi / 6)),
                    (x, y, (theta, 3 * pi / 6, 5 * pi / 6)),
                    show=False)


colors = ['red', 'green', 'blue', 'brown', 'orange', 'pink']
for i, s in enumerate(p):
    s.line_color = colors[i]
p.save('sample9.png')

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

C:\Users\...> py -3 sample9.py
5⋅π             
───             
 6              
 ⌠              
 ⎮     2        
 ⎮  cos (3⋅θ)   
 ⎮  ───────── dθ
 ⎮      2       
 ⌡              
-π              
───             
 6              

π
─
4

C:\Users\...>

0 コメント:

コメントを投稿