Solve an Integral in Java
Take a look at JScience
The Apache Commons Math library contains, in the Numerical Analysis section, four different numerical integrators:
- Romberg's method
- Simpson's method
- trapezoid method
- Legendre-Gauss method
The Wikipedia article on Numerical Integration has a section on methods for one-dimensional integrals.
You should have no problem implementing the "trapezoidal" or "rectangle" rule.