Напиши комментарии к каждой строчке кода: 
namespace alga1 
{ 
    public partial class Form1 : Form 
    { 
        public Form1() 
        { 
            InitializeComponent(); 
        } 
 
        private void label2_Click(object sender, EventArgs e) 
        { 
 
        } 
        static double sinx(double x) 
        { 
            return Math.Sin(x); // заменить на нужную функцию 
        } 
        static double cos2x(double x) 
        { 
            return Math.Cos(2 * x); // заменить на нужную функцию 
        } 
        static double Function(double x) 
        { 
            return Math.Pow(x, 2) * Math.Exp(Math.Pow(-x, 2)); // заменить на нужную функцию 
        } 
 
        static double SimpsonMethod(double a, double b, int n, string chooice) 
        { 
            double h = (b - a) / n; 
            double sum1 = 0, sum2 = 0; 
 
            if (chooice == "sin(x)") 
            { 
                for (int i = 1; i < n; i += 2) 
                { sum1 += sinx(a + i * h); } 
 
                for (int i = 2; i < n; i += 2) 
                { sum2 += sinx(a + i * h); } 
                return h / 3 * (sinx(a) + sinx(b) + 4 * sum1 + 2 * sum2); 
 
            } 
            else if (chooice == "cos(2x)") 
            { 
                for (int i = 1; i < n; i += 2) 
                { sum1 += cos2x(a + i * h); } 
 
                for (int i = 2; i < n; i += 2) 
                { sum2 += cos2x(a + i * h); } 
                return h / 3 * (cos2x(a) + cos2x(b) + 4 * sum1 + 2 * sum2); 
            } 
            else if (chooice == "x^2 * e^(-x^2)") 
            { 
                for (int i = 1; i < n; i += 2) 
                { sum1 += Function(a + i * h); } 
 
                for (int i = 2; i < n; i += 2) 
                { sum2 += Function(a + i * h); } 
                return h / 3 * (Function(a) + Function(b) + 4 * sum1 + 2 * sum2); 
            } 
            else 
            { 
                return 5; 
            } 
 
        } 
        static double GaussKronrodMethod(Func<double, double> f, double a, double b, int n) 
        { 
            double[] x = new double[] 
            { -0.991455371120813, -0.949107912342759, -0.864864423359769, -0.741531185599394, -0.586087235467691, -0.405845151377397, -0.207784955007898, 0, 0.207784955007898, 0.405845151377397, 0.586087235467691, 0.741531185599394, 0.864864423359769, 0.949107912342759, 0.991455371120813 }; 
            double[] w = new double[] 
            { 0.022935322010529, 0.063092092629979, 0.104790010322250, 0.140653259715525, 0.169004726639267, 0.190350578064785, 0.204432940075298, 0.209482141084728, 0.204432940075298, 0.190350578064785, 0.169004726639267, 0.140653259715525, 0.104790010322250, 0.063092092629979, 0.022935322010529 }; 
            double h = (b - a) / n; 
            double sum1 = 0, sum2 = 0; 
            for (int i = 0; i < n; i++) 
            { 
                double xi = a + (i + 0.5) * h; 
                for (int j = 0; j < x.Length; j++) 
                { 
                    double xj = xi + (x[j] * h / 2); 
                    double fj = f(xj); 
                    if (j < 8) 
                    { 
                        sum1 += w[j] * fj; 
                    } 
                    else 
                    { 
                        sum2 += w[j] * fj; 
                    } 
                } 
            } 
            return h / 2 * (sum1 + sum2); 
        } 
        static double RungeControl(double I1, double I2, double k) 
        { 
            return Math.Abs(I1 - I2) / (Math.Pow(2, k) - 1); 
        } 

        private void Form1_Load(object sender, EventArgs e) 
        { 
            comboBox1.Items.Add("sin(x)"); 
            comboBox1.Items.Add("cos(2x)"); 
            comboBox1.Items.Add("x^2 * e^(-x^2)"); 
            comboBox2.Items.Add("Симпсона"); 
            comboBox2.Items.Add("Гаусса - Кронрода"); 
            textBox3.Text = "4"; 
        } 
   }