/* Mitch Burkert
 * ERG 345 LAb 2
 * numerical intergration*/

#include<stdio.h>
#include<math.h>


int main (void)

{
    double start, stop, t, z, step, delta_t, y = 0;
    int i;


    printf("Enter the start value for the equation ");
    scanf("%lf",&start);
    printf("\n");
    printf("Enter the end value for the equation ");
    scanf("%lf",&stop);
    printf("\n");
    printf("Enter the number of steps ");
    scanf("%lf",&step);
    printf("\n");
    
    delta_t = ((stop - start) / step);

    printf("delta_t= %lf\n",delta_t);
    printf("\n");

    for (i=0; i < step; i++)
    {
        t = start + i*delta_t;
        y = y+5*t+(sin(9*t-5)/t);

    }

    z = y*delta_t;

    printf ( " The integration of the equationt gives us: %lf \n\n",z);
                
    return 0;


}