2019年9月15日日曜日

学習環境

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


  1. d dx e x sin x = e x sin x + e x cos x = e x sin x + cos x = e x 2 1 2 sin x + 1 2 cos x = 2 1 e x sin x cos π 4 + cos x sin π 4 = 2 1 e x sin x + 1 · π 4

    また、

    d n dx n e x sin x = d dx 2 n - 1 e x sin x + n - 1 π 4 = 2 n - 1 e x sin x + n - 1 π 4 + e x cos x + n - 1 π 4 = 2 n - 1 e x sin x + n - 1 π 4 + cos x + n - 1 π 4 = 2 n e x 1 2 sin x + n - 1 π 4 + 1 2 cos x + n - 1 π 4 = 2 n e x sin x + n - 1 π 4 cos π 4 + sin π 4 cos x + n - 1 π 4 = 2 n e x sin x + n - 1 π 4 + π 4 = 2 n e x sin x + n π 4

    よって帰納法により 成り立つ。

    (証明終)

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, sqrt, sin, exp, Derivative, pi, plot

print('4.')

x = symbols('x')
n = symbols('n', integer=True)
f = exp(x) * sin(x)
d = Derivative(f, x, 1)
d1 = d.doit()
g = sqrt(2) ** n * exp(x) * sin(x + n * pi / 4)

for o in [d, d1]:
    pprint(o.factor())
    print()

ns = range(1, 6)
p = plot(*[d1.subs({n: n0}) for n0 in ns],
         *[g.subs({n: n0}) for n0 in ns],
         (x, -5, 5),
         ylim=(-5, 5),
         show=False,
         legend=False)

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

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

for t in zip(p, colors):
    pprint(t)
    print()
p.show()
p.save('sample4.png')

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

C:\Users\...>py sample4.py
4.
d ⎛ x       ⎞
──⎝ℯ ⋅sin(x)⎠
dx           

                   x
(sin(x) + cos(x))⋅ℯ 

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), red)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), green)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), blue)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), brown)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), orange)

(cartesian line: sqrt(2)*exp(x)*sin(x + pi/4) for x over (-5.0, 5.0), purple)

(cartesian line: 2*exp(x)*cos(x) for x over (-5.0, 5.0), pink)

(cartesian line: 2*sqrt(2)*exp(x)*cos(x + pi/4) for x over (-5.0, 5.0), gray)

(cartesian line: -4*exp(x)*sin(x) for x over (-5.0, 5.0), skyblue)

(cartesian line: -4*sqrt(2)*exp(x)*sin(x + pi/4) for x over (-5.0, 5.0), yello
w)


C:\Users\...>

0 コメント:

コメントを投稿