学習環境
- Surface
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第8章(積分の計算)、8.1(不定積分の計算)、問題3の解答を求めてみる。
以下積分定数は省略。
とおき、 x で微分すると、
よって、
とおくと、
よって、
コード
#!/usr/bin/env python3
from sympy import pprint, symbols, Integral, sqrt, plot
print('3.')
x, a = symbols('x, a')
fs = [sqrt(x ** 2 + a),
sqrt((1 - x) / (1 + x)),
1 / (x * sqrt(x ** 2 + 1)),
1 / ((x - 1) * sqrt(x ** 2 - 1))]
for i, f in enumerate(fs, 1):
print(f'({i})')
I = Integral(f, x)
for o in [I, I.doit()]:
pprint(o)
print()
p = plot(*[f.subs({a: 2}) for f in fs],
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('sample3.png')
入出力結果(Zsh、PowerShell、Terminal、Jupyter(IPython))
% ./sample3.py
3.
(1)
⌠
⎮ ________
⎮ ╱ 2
⎮ ╲╱ a + x dx
⌡
________
╱ 2
╱ x ⎛x ⎞
√a⋅x⋅ ╱ 1 + ── a⋅asinh⎜──⎟
╲╱ a ⎝√a⎠
────────────────── + ───────────
2 2
(2)
⌠
⎮ _______
⎮ ╱ 1 - x
⎮ ╱ ───── dx
⎮ ╲╱ x + 1
⌡
⌠
⎮ _______
⎮ ╱ 1 - x
⎮ ╱ ───── dx
⎮ ╲╱ x + 1
⌡
(3)
⌠
⎮ 1
⎮ ───────────── dx
⎮ ________
⎮ ╱ 2
⎮ x⋅╲╱ x + 1
⌡
⎛1⎞
-asinh⎜─⎟
⎝x⎠
(4)
⌠
⎮ 1
⎮ ─────────────────── dx
⎮ ________
⎮ ╱ 2
⎮ (x - 1)⋅╲╱ x - 1
⌡
⌠
⎮ 1
⎮ ─────────────────────────── dx
⎮ _________________
⎮ ╲╱ (x - 1)⋅(x + 1) ⋅(x - 1)
⌡
%
(4)の積分は求められてないし、SymPyには苦手な積分、不定積分があるみたい。
0 コメント:
コメントを投稿