C# trapezoidal rule sum of y value
<p>Our teacher asked us to use C# to do a trapezoidal rule solution;
He wants us to break it down into three methods.
Below is the the question and my code so far:</p>

<blockquote>
  <p>Numerical integration is a technique that is particular suitable for
  computer applications. In exercise we will try to implement the
  trapezoidal rule. The integral of a mathematical function is the area
  between the curve and the x-axis. If the area is divided into little
  trapezoids, then the integral is approximated by the area of these
  geometrical figures. </p>
  
  <p>You will try to find the area under the curve y = 6x^2-7x+2 in the
  region from x = 0.5 to x = 1.5 (N.B. your answer should work out to
  about be 1.54, however the actual answer is 1.5). The area is given by
  the formula<br>
  <img src="https://i.stack.imgur.com/k7IYe.png" alt="(xb - xa) / 2N * (y0 + 2*y1 + 2*y2 + ⋯ + 2*yn + y(n+1))"> </p>
  
  <p>where y0 and y1 are the height of the vertical lines i.e. the value of
  the function. </p>
  
  <p>This problem can be decomposed into three parts as follows:</p>
  
  <ul>
  <li><p>Write a method called EvaluateQuadraticValue(double x, double a,    double b, double c) that takes four double arguments: the value of x, 
  the coefficient of the x2 term, the coefficient of the x and the<br>
  constant. The method will compute and return the result value of y<br>
  given by the expression y = ax2+ba+c.</p></li>
  <li><p>Write a method called ComputeQuadraticValues(double startX, double    increments, int numberOfIntervals, double a, double b, double c) that 
  takes six arguments: the start value of x, the increments and the<br>
  number of intervals and the coefficients of the quadratic equation.<br>
  This method will figure out the values of x0, x1, x2 etc. by invoking 
  the previous question. The results of the methods calls are collected 
  and returned as a double array.</p></li>
  <li><p>Write a method called ApplyTrapeziodalRule(double startX, double    endX, int numberOfIntervals, double a, double b, double c) . The<br>
  arguments are described in the previous question. This method calls<br>
  the previous method and process the double array that is returned to<br>
  compute the area under the curve by applying the formula<br>
  <img src="https://i.stack.imgur.com/9A9zJ.png" alt="(xb - xa) / 2N * (y0 + 2*y1 + 2*y2 + ⋯ + 2*yn + y(n+1))"></p></li>
  </ul>
</blockquote>

<p>And my code so far:</p>

<pre><code>    public static double EvaluateQuadraticValue(double x, double a, double b, double c)
    {
        double y = a * Math.Pow(x, 2) + b * x + c;
        Console.WriteLine("The y coordinate for this x is: {0}", y);
        return y;
    }

    public static double[] ComputeQuadraticValues(double startX, double increments, int numberOfIntervals, double a, double b, double c)
    {

        double[] xPoints = new double[numberOfIntervals];
        for (int index = 0; index &lt; numberOfIntervals; index++)
        {
            xPoints[index] = startX;
            Console.WriteLine("X{0} is {1}: ",index, xPoints[index]);
            EvaluateQuadraticValue(startX, a, b, c);
            startX = startX + increments;
        }
        return xPoints;
    }

    public static void ApplyTrapeziodalRule(double startX, double endX, int numberOfIntervals, double a, double b, double c)
    {
        double increments = Convert.ToInt32(Console.ReadLine());
        double[] xPoints = ComputeQuadraticValues(startX, increments, numberOfIntervals, a, b, c);
        //double[] values = a * Math.Pow(xPoints[i], 2) + b * xPoints[i] + c;
        //double y = xPoints.Sum();
        /*for (int i = 0; i &lt; numberOfIntervals; i++)
        {

        }*/
        //Console.WriteLine(y + " sum");
    }
</code></pre>

<p>Currently I'm having trouble with the third method.
Since my double array from <code>ComputeQuadraticValues()</code> are x0, x1, x2 etc. How do I use this array to get (y0 + 2*y1 + 2*y2 + ...... + 2*yn + y(n+1))?</p>

<p>Any hints or tips are appreciated!</p>