using System using System Collections Generic using System Linq using

 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double a, b, x, dx, s; int n;
a = 0.0; b = 3.0; x = a;
s = Math.Atan(Math.Sqrt(x / (x + 1)));
n = 36;
dx = (b - a) / Convert.ToDouble(n);
do
{
x = x + dx;
s = s + 2 * Math.Atan(Math.Sqrt(x / (x + 1)));
}
while (x < b);
s = s * dx / 2.0;
Console.WriteLine("Интеграл = {0:f4}", s);
Console.ReadKey();
}
}
}