Numerical integration: Difference between revisions
Content added Content deleted
m (Moved to Arith cat) |
|||
Line 1: | Line 1: | ||
{{task}} |
{{task|Arithmetic operations}} |
||
Write functions to calculate the definite integral of a function (<tt>f(x)</tt>) using rectangular (left, right, and midpoint), trapezium, and Simpson's methods. Your functions should take in the upper and lower bounds (<tt>a</tt> and <tt>b</tt>) and the number of approximations to make in that range (<tt>n</tt>). Assume that your example already has a function that gives values for <tt>f(x)</tt>. |
Write functions to calculate the definite integral of a function (<tt>f(x)</tt>) using rectangular (left, right, and midpoint), trapezium, and Simpson's methods. Your functions should take in the upper and lower bounds (<tt>a</tt> and <tt>b</tt>) and the number of approximations to make in that range (<tt>n</tt>). Assume that your example already has a function that gives values for <tt>f(x)</tt>. |
||