kxcoze

lab6_22

Feb 4th, 2020
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from math import log, sin, tan
  2.  
  3. def intg(x, n):
  4.     if n >= 2:
  5.         return (-((tan(x) ** -1) ** n - 1) / (n - 1)) - intg(x, n - 2)
  6.     if n == 1:
  7.         return log(abs(sin(x)))
  8.     if n == 0:
  9.         return x
  10.  
  11. n = int(input('Введите степень n: '))
  12.  
  13. a, b = [float(x) for x in input('Введите а(от) и b(до): ').split()]
  14.  
  15. print('Интеграл для заданных границ а и b равен:', intg(b, n) - intg(a, n))
Advertisement
Add Comment
Please, Sign In to add comment