## 2020年1月21日火曜日

### 数学 - Python - 解析学 - 積分の計算 - 定積分の計算 - 連続関数、累乗、帰納法、部分積分法

1. 関数 f の原始関数を F とおくと、

$\begin{array}{l}\frac{d}{\mathrm{dx}}{\int }_{0}^{x}f\left(t\right){\left(x-t\right)}^{0}\mathrm{dt}\\ =\frac{d}{\mathrm{dx}}{\int }_{0}^{x}f\left(t\right)\mathrm{dt}\\ =f\left(x\right)\\ g\left(x\right)\\ ={\int }_{0}^{x}f\left(t\right){\left(x-t\right)}^{n}\mathrm{dt}\\ ={\left[F\left(t\right){\left(x-t\right)}^{n}\right]}_{0}^{x}-{\int }_{0}^{x}F\left(t\right)\frac{1}{n}{\left(x-t\right)}^{n-1}\mathrm{dt}\\ =-F\left(0\right){x}^{n}+n{\int }_{0}^{x}F\left(t\right){\left(x-t\right)}^{n-1}\mathrm{dt}\\ \frac{{d}^{n+1}}{{\mathrm{dx}}^{n+1}}g\left(x\right)\\ =\frac{d}{\mathrm{dx}}\left(\frac{{d}^{n}}{{\mathrm{dx}}^{n}}g\left(x\right)\right)\\ =\frac{d}{\mathrm{dx}}\left(-F\left(0\right)+n\frac{{d}^{n}}{{\mathrm{dx}}^{n}}{\int }_{0}^{x}F\left(t\right){\left(x-t\right)}^{n-1}\mathrm{dt}\right)\\ =\frac{d}{\mathrm{dx}}\left(n\left(n-1\right)!F\left(x\right)\right)\\ =n!f\left(x\right)\end{array}$

よって、 帰納法によりすべての自然数数 n に対に成り立つ。

（証明終）

コード

#!/usr/bin/env python3
from unittest import TestCase, main
from sympy import pprint, symbols, Integral, factorial, Derivative, plot

print('10.')

x, t = symbols('x, t')
f = x ** 2 + 3
n = symbols('n', integerr=True, positive=True)
g = Integral(f.subs({x: t}) * (x - t) ** n, (t, 0, x))

class MyTestCase(TestCase):
def test(self):
for n0 in range(10):
self.assertEqual(Derivative(g.subs({n: n0}), x, n0 + 1).subs({n: n0}).doit().simplify(),
factorial(n0) * f)

p = plot(f,
*[g.subs({n: n0}).doit() for n0 in range(4)],
*[factorial(n0) * f for n0 in range(4)],
(x, -5, 5),
ylim=(-5, 5),
legend=False,
show=False)

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

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

for o in zip(p, colors):
pprint(o)

p.show()
p.save('sample9.png')

if __name__ == '__main__':
main()


% ./sample9.py
9.
∞
⌠
⎮  -a
⎮ x  ⋅sin(x) dx
⌡
0

⎧     a   1
⎪   - ─ - ─
⎪     2   2     ⎛    a⎞
⎪2⋅4       ⋅√π⋅Γ⎜1 - ─⎟
⎪               ⎝    2⎠
⎪──────────────────────  for a > 0 ∧ a < 2
⎪        ⎛a   1⎞
⎪       Γ⎜─ + ─⎟
⎨        ⎝2   2⎠
⎪
⎪   ∞
⎪   ⌠
⎪   ⎮  -a
⎪   ⎮ x  ⋅sin(x) dx          otherwise
⎪   ⌡
⎪   0
⎩

∞
⌠
⎮ sin(x)
⎮ ────── dx
⎮   √x
⌡
0

√2⋅√π
─────
2

∞
⌠
⎮ sin(x)
⎮ ────── dx
⎮   x
⌡
0

π
─
2

∞
⌠
⎮ sin(x)
⎮ ────── dx
⎮   3/2
⎮  x
⌡
0

√2⋅√π

∞
⌠
⎮ │sin(x)│
⎮ ──────── dx
⎮   │ a│
⎮   │x │
⌡
0

∞
⌠
⎮ │sin(x)│
⎮ ──────── dx
⎮   │ a│
⎮   │x │
⌡
0

(cartesian line: sin(x) for x over (0.1, 10.0), red)
(cartesian line: sqrt(x) for x over (0.1, 10.0), green)
(cartesian line: x for x over (0.1, 10.0), blue)
(cartesian line: x**(3/2) for x over (0.1, 10.0), brown)
(cartesian line: sin(x)/sqrt(x) for x over (0.1, 10.0), orange)
(cartesian line: sin(x)/x for x over (0.1, 10.0), purple)
(cartesian line: sin(x)/x**(3/2) for x over (0.1, 10.0), pink)
(cartesian line: Abs(sin(x))/Abs(sqrt(x)) for x over (0.1, 10.0), gray)
(cartesian line: Abs(sin(x))/Abs(x) for x over (0.1, 10.0), skyblue)
(cartesian line: Abs(sin(x))/Abs(x**(3/2)) for x over (0.1, 10.0), yellow)
%