Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import log, sin, tan
- def intg(x, n):
- if n >= 2:
- return (-((tan(x) ** -1) ** n - 1) / (n - 1)) - intg(x, n - 2)
- if n == 1:
- return log(abs(sin(x)))
- if n == 0:
- return x
- n = int(input('Введите степень n: '))
- a, b = [float(x) for x in input('Введите а(от) и b(до): ').split()]
- print('Интеграл для заданных границ а и b равен:', intg(b, n) - intg(a, n))
Advertisement
Add Comment
Please, Sign In to add comment