Processing math: 25%

2019年9月26日木曜日

学習環境

解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第5章(各種の初等関数)、5.4(三角関数(続き)、逆三角関数)、問題12の解答を求めてみる。


  1. 台形の面積は、

    0<θ<π2S(θ)=(2a(cosθ)+a+a)a(sinθ)2=a2(cosθ+1)sinθ

    よって、

    0<θ<π2S'

    ゆえに、 角が

    2 cos θ - 1 = 0 cos θ = 1 2 θ = π 3

    のとき問題の図の台形の面積は最大になる。

    この時の台形の面積は、

    a 2 1 2 + 1 sin π 3 = 3 2 · 3 2 · a 2 = 3 3 4 a 2

    である。

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, sin, cos, Derivative, solve, plot

print('12.')

x = symbols('x')
a = 2
f = a ** 2 * (cos(x) + 1) * sin(x)
g = Derivative(f, x, 1).doit()
pprint(solve(g))

p = plot(f, g,
         ylim=(-10, 10),
         show=False,
         legend=True)

colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

for o, color in zip(p, colors):
    o.line_color = color

p.show()
p.save(f'sample12.png')

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

$ ./sample12.py
12.
⎡-π   π⎤
⎢───, ─⎥
⎣ 3   3⎦
$

0 コメント:

コメントを投稿