LoginSignup
0
0

More than 5 years have passed since last update.

sympyで(積分)「2019 名古屋大学 前期日程 数学(理系) [1]」 をやってみたい

Posted at

読売新聞
https://www.yomiuri.co.jp//nyushi/sokuho/k_mondaitokaitou/nagoya/mondai/img/nagoya_zenki_sugaku_ri_mon.pdf
https://www.yomiuri.co.jp//nyushi/sokuho/k_mondaitokaitou/nagoya/mondai/img/nagoya_zenki_sugaku_ri_mon.pdf

wolframalpha
(1) わかりませんでした。
Integrate[1/cos(x),{x,0,pi/3}]
https://www.wolframalpha.com/input/?i=Integrate%5B1%2Fcos(x),%7Bx,0,pi%2F3%7D%5D
integral_0^(π/3) 1/cos(x) dx = 2 coth^(-1)(sqrt(3))?1.3170
2 ArcCoth[Sqrt[3]]

(2) わかりませんでした。
Integrate[1/cos(x)n,{x,0,pi/3}]
https://www.wolframalpha.com/input/?i=Integrate%5B1%2Fcos(x)
n,%7Bx,0,pi%2F3%7D%5D
((Sqrt[Pi] Gamma[1/2 - n/2])/Gamma[1 - n/2] + (2^n Hypergeometric2F1[1/2, (1 - n)/2, (3 - n)/2, 1/4])/(-1 + n))/2

fullscript.py
from sympy import *
x = Symbol('x')
n = symbols('n', integer=True)
print('(1)--------------------------------------------')
f=1/cos(x)
print(f)
print(integrate(f,(x, 0, pi/3)))

print('(2)--------------------------------------------')
f=1/cos(x)**n
print(f)
print(integrate(f,(x, 0, 1)))
# (1)--------------------------------------------
# 1/cos(x)
# log(sqrt(3)/2 + 1)/2 - log(-sqrt(3)/2 + 1)/2
# (2)--------------------------------------------
# cos(x)**(-n)
# Integral(cos(x)**(-n), (x, 0, 1))
0
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
0
0