Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- double intg(double x, int n) {
- if (n >= 2)
- return (-(pow(pow(tan(x), -1), n - 1)) / (n - 1)) - intg(x, n - 2);
- if (n == 1)
- return log(abs(sin(x)));
- if (n == 0)
- return x;
- }
- int main() {
- setlocale(LC_ALL, "rus");
- int n;
- cout << "Введите степень n: ";
- cin >> n;
- double a, b;
- cout << "Введите а(от) и b(до): " << endl;
- cin >> a >> b;
- cout << "Интеграл для заданных границ a и b равен: " << intg(b, n) - intg(a, n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement