LoginSignup
1
0

More than 5 years have passed since last update.

sympyで「Python - 数値積分 台形法 & シンプソン法」を参考にした

Last updated at Posted at 2017-06-12

(参考)Python - 数値積分 台形法 & シンプソン法
http://qiita.com/popondeli/items/fbc602b80223227f3d0e

from sympy import *
var("x a b")
f=x**5
print(integrate(f))
print(integrate(f, (x, a, b)))
a=0
b=2
print(integrate(f, (x, a, b)))
print(float(integrate(x**5, (xx**6/6

# x**6/6
# -a**6/6 + b**6/6
# 32/3
# 10.666666666666666

(参考)Wolfram|Alpha: Computational Knowledge Engine>int(x^5)
http://www.wolframalpha.com/input/?i=int(x%5E5)
x^6/6
(参考)Wolfram|Alpha: Computational Knowledge Engine>Integrate[x^5, {x, 0, 2}]
http://www.wolframalpha.com/input/?i=Integrate%5Bx%5E5,+%7Bx,+0,+2%7D%5D
integral_0^2 x^5 dx = 32/3≈10.667

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0