2019年9月16日月曜日

学習環境

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



    1. f ' x = - a · sin log x · 1 x + b cos log x · 1 x = 1 x - a · sin log x + b cos log x f ' ' x = - a · cos log x - b sin log x + a · sin log x - b cos log x x 2 = - 1 x 2 b sin log x + a · cos log x - a · sin log x + b cos log x

      よって、

      x 2 f ' ' x + x f ' x + f x = - b sin log x - a · cos log x + a · sin log x - b cos log x - a · sin log x + b cos log x + a · cos log x + b sin ( o g x = 0

    2. f n x = d dx f n - 1 x = d dx 1 x n - 1 a n - 1 cos log x + b n - 1 sin log x = - a n - 1 sin log x 1 x + b n - 1 cos log x 1 x x n - 1 x 2 n - 1 - a n - 1 cos log x + b n - 1 sin log x n - 1 x n - 2 x 2 n - 1 = 1 x n - a n - 1 + b n - 1 cos log x + - a n - 1 - b n - 1 sin log x x n f n x = - a n - 1 + b n - 1 cos log x + - a n - 1 - b n - 1 sin log x

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

      (証明終)

コード

Python 3

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

print('5.')

print('(a)')
x, a, b = symbols('x, a, b')
f = a * cos(log(x)) + b * sin(log(x))
d1 = Derivative(f, x, 1).doit()
d2 = Derivative(f, x, 2).doit()
eq = x ** 2 * d2 + x * d1 + f

for o in [eq, eq.expand()]:
    pprint(o)
    print()

print('(b)')
n = symbols('n', integer=True, nonnegative=True)
for n in range(5):
    g = x ** n * Derivative(f, x, n)
    for o in [g, g.doit()]:
        pprint(o)
        print()

p = plot(*[Derivative(f.subs({a: 2, b: 3}), x, n).doit() for n in range(5)],
         (x, 0.1, 10.1),
         ylim=(-5, 5),
         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('sample5.png')

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

C:\Users\...>py sample5.py
5.
(a)
                                  ⎛  a⋅sin(log(x))   b⋅cos(log(x))⎞
a⋅sin(log(x)) - b⋅cos(log(x)) + x⋅⎜- ───────────── + ─────────────⎟
                                  ⎝        x               x      ⎠

0

(b)
a⋅cos(log(x)) + b⋅sin(log(x))

a⋅cos(log(x)) + b⋅sin(log(x))

  ∂                                
x⋅──(a⋅cos(log(x)) + b⋅sin(log(x)))
  ∂x                               

  ⎛  a⋅sin(log(x))   b⋅cos(log(x))⎞
x⋅⎜- ───────────── + ─────────────⎟
  ⎝        x               x      ⎠

     2                               
 2  ∂                                
x ⋅───(a⋅cos(log(x)) + b⋅sin(log(x)))
     2                               
   ∂x                                

a⋅sin(log(x)) - a⋅cos(log(x)) - b⋅sin(log(x)) - b⋅cos(log(x))

     3                               
 3  ∂                                
x ⋅───(a⋅cos(log(x)) + b⋅sin(log(x)))
     3                               
   ∂x                                

-a⋅sin(log(x)) + 3⋅a⋅cos(log(x)) + 3⋅b⋅sin(log(x)) + b⋅cos(log(x))

     4                               
 4  ∂                                
x ⋅───(a⋅cos(log(x)) + b⋅sin(log(x)))
     4                               
   ∂x                                

-10⋅a⋅cos(log(x)) - 10⋅b⋅sin(log(x))


C:\Users\...>

0 コメント:

コメントを投稿