## 2020年8月2日日曜日

### 数学 - Python - 微分積分学 - 積分法 - 不定積分の計算 - 部分積分法、漸化式、累乗と平方根の積

1. $\frac{d}{\mathrm{dx}}\left(\frac{2}{3+2m}{x}^{m}\left(x+a\right)\sqrt{x+a}-\frac{2ma}{3+2m}{I}_{m-1}\right)$
$=\frac{2}{3+2m}\left(m{x}^{m-1}\left(x+a\right)\sqrt{x+a}+{x}^{m}\sqrt{x+a}+\frac{{x}^{m}\sqrt{x+a}}{2}-ma\left({x}^{m-1}\sqrt{x+a}\right)\right)$
$=\frac{2{x}^{m-1}\sqrt{x+a}}{3+2m}\left(m\left(x+a\right)+x+\frac{x}{2}-ma\right)$
$=\frac{2{x}^{m-1}\sqrt{x+a}}{3+2m}\left(mx+\frac{3}{2}x\right)$
$=\frac{2{x}^{m}\sqrt{x+a}}{3+2m}\left(m+\frac{3}{2}\right)$
$=\frac{{x}^{m}\sqrt{x+a}}{3+2m}\left(2m+3\right)$
$={x}^{m}\sqrt{x+a}$

よって、

${I}_{m}=\frac{2}{3+2m}{x}^{m}\left(x+a\right)\sqrt{x+a}-\frac{2ma}{3+2m}{I}_{m-1}$

（証明終）

コード

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

print('10.')

m = symbols('m', positive=True)
x, a = symbols('x, a', real=True)
f = x ** m * sqrt(x + a)

class Test(TestCase):
def test(self):
self.assertEqual(
f,
(
Derivative(2 * x ** m * (x + a) * sqrt(x + a) / (3 + 2 * m),
x,
1).doit() -
2 * m * a * f.subs({m: m-1}) / (3 + 2 * m)
).simplify()
)

p = plot(*[f.subs({m: m0, a: 1}) for m0 in range(1, 5)],
(x, -1, 4),
ylim=(-2.5, 2.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(f'sample10.png')
if __name__ == "__main__":
main()


% ./sample10.py -v
10.
test (__main__.Test) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.304s

OK
%