LoginSignup
1
0

More than 1 year has passed since last update.

(積分)「youtubeの【高校数学】今週の積分」 をsympyでやってみたい

Last updated at Posted at 2019-07-11

オリジナルリンク

fullscript.py
# wolframalpha
# https://www.wolframalpha.com/input/?i=sin(1%2Fx)%2Fx**3
# Cos[x^(-1)]/x - Sin[x^(-1)]
from sympy import *
var("x")
f=sin(1/x)/x**3
print(integrate(f,x))
# -sin(1/x) + cos(1/x)/x

fullscript.py
# wolframalpha
# https://ja.wolframalpha.com/input/?i=-1%E3%81%8B%E3%82%891%E3%81%AE%E7%AF%84%E5%9B%B2%E3%81%A7x**2%2F(1%2Bexp(x))%E3%82%92%E7%A9%8D%E5%88%86
# -1から1の範囲でx**2/(1+exp(x))を積分
# 0.333333
from sympy import *
var("x")
f=x**2/(1+exp(x))
print(integrate(f,(x,-1,1)))
# sympyで計算してくれない。
# Integral(x**2/(exp(x) + 1), (x, -1, 1))
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