My apology- I misread your first post and though you were asking for the error formulas rather than 'finding "K" in the error bound equations'. However, now I have to point out that not every text writes the formulas in exactly the same way- some I am not sure what "K" represents. The formulas on the page do not use "K". I suspect, however, that it is what the formulas I use call "M"- an upper bound on
in the case of the trapezoidal rule, first derivative of the integrand
in the case of the mid-point rule, the second derivative of the integrand
in the case of Simpson's rule, the fourth derivative of the integrand
There is no rule for determining those- remember these are "approximations"- obviously you can't find the exact value of the error! If you could, you could just add it on to get an exact value for the integral!
Essentially, you find the correct derivative and extimate how large it can be in that interval. For sine or cosine, for example, you know the value is never larger than 1. For an increasing function like ex, use the right endpoint.