I want to integrate the sin (a \* x) \* sin (b \* x) function using the [trapezoidal method](https://en.wikipedia.org/wiki/Trapezoidal_rule).

I would like to be able to enter the values of a and b to the function without defining those values within the function, for example:

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

float myfunc(float x, float aa, float bb) {
  return sin(aa * x) * sin(bb * x);
}

float trapzd(float (*func)(float), float a, float b, int n) {
  float x, tnm, sum, del;
  static float s;
  int it, j;
  if (n == 1) {
    return (s = 0.5 * (b - a) * (h(a) + h(b)));

  } else {
    for (it = 1, j = 1; j <n-1; j ++) it << = 1;
    tnm = it;
    del = (b - a) / tnm;
    x = a + 0.5 * del;
    for (sum = 0.0, j = 1; j <= it; j ++, x + = del) sum + = h (x);
    s = 0.5 * (s + (b - a) * sum / tnm);
    return s;
  }

int main() {
  printf("%f\n", 2*trapzd(myfunc(float x, 0, 5),0,1,5)); // Not correct
}

```

I understand that in order to integrate myfunc, it should have a single floating argument "x", how could I add more arguments to the myfunc function (aa and bb)?

thanks