Loading [MathJax]/jax/output/HTML-CSS/jax.js

2019年9月16日月曜日

学習環境

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



    1. f'(x)=-a·sin(logx)·1x+bcos(logx)·1x=1x(-a·sin(logx)+bcos(logx))f''(x)=-a·cos(logx)-bsin(logx)+a·sin(logx)-bcos(logx)x2=-1x2(bsin(logx)+a·cos(logx)-a·sin(logx)+bcos(logx))

      よって、

      x2f''(x)+xf'(x)+f(x)=-bsin(logx)-a·cos(logx)+a·sin(logx)-bcos(logx)-a·sin(logx)+bcos(logx)+a·cos(logx)+bsin((ogx)=0

    2. f(n)(x)=ddxf(n-1)(x)=ddx(1xn-1(an-1cos(logx)+bn-1sin(logx)))=(-an-1sin(logx)1x+bn-1cos(logx)1x)xn-1x2(n-1)-(an-1cos(logx)+bn-1sin(logx))(n-1)xn-2x2(n-1)=1xn((-an-1+bn-1)cos(logx)+(-an-1-bn-1)sin(logx))xnf(n)(x)=(-an-1+bn-1)cos(logx)+(-an-1-bn-1)sin(logx)

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

      (証明終)

コード

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 コメント:

コメントを投稿