:*

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static double f(double x)
{
return Math.Asin(Math.Sqrt(1/(1 +x )));
}
static double F(double x)
{
return x * Math.Asin(Math.Sqrt(x / (1 + x))) - Math.Sqrt(x) + Math.Atan(Math.Sqrt(x));
}
static double Simpson(double a, double b, int n)
{
double s, x, c, h;
int i;
s = f(a) + f(b);
h = (b - a) / n;
x = a;
c = 1;
do
{
x = x + h;
s = s + 2 * f(x);
c = -c;
}
while(x < b);
return s * h / 3;
}
static void Main(string[] args)
{
double Int;
Int = Simpson(0, 3, 36);
Console.WriteLine("Интеграл = {0:f4}", Int);
Console.ReadKey();
}
}
}