学習環境
微分積分学
(ちくま学芸文庫)
(吉田
洋一(著)、筑摩書房)のⅢ.(平均値の定理)、演習問題Ⅲ、問6、7、8、9、10.の解答を求めてみる。
よって、 求める極大値は10、17。 極小値は0。
#!/usr/bin/env python3
from sympy import pprint, symbols, plot, root, sqrt
print('6.')
x = symbols('x')
fs = [3 * x ** 4 - 4 * x ** 3 - 12 * x ** 2 + 5,
(x ** 2 - x + 2) / (x ** 2 + x + 2),
root((x - 1) * (x - 2) ** 2, 3),
abs(2 * x ** 3 + 3 * x ** 2 - 12 * x - 10),
abs(x ** 3 - 3 * x + 8)]
cs = [5, 0, -27, (9 + 4 * sqrt(2)) / 7, (9 - 4 * sqrt(2)) /
7, root(4, 3) / 3, 0, 10, 17, 0, 10, 0, 60, ]
p = plot(*fs,
5, 0, -27, (9 + 4 * sqrt(2)) / 7, (9 - 4 * sqrt(2)) /
7, root(4, 3) / 3, 0, 10, 17, 0, 10, 0, 60,
(x, -4, 4),
ylim=(-30, 20),
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, color in zip(fs + cs, colors):
print(o, color)
p.show()
p.save('sample6.png')
0 コメント:
コメントを投稿