title: Python: How to integrate a math function using only math module?
body: <p>Just started learning python, and was asked to define a python function that integrate a math function.</p>
  
  <p>We were instructed that the python function must be in the following form: (for example, to calculate the area of <code>y = 2x + 3</code> between <code>x=1</code> and <code>x=2</code> )</p>
  
  <pre><code>integrate( 2 * x + 3, 1, 2 )
  </code></pre>
  
  <p>(it should return the area below)</p>
  
  <p>and we are <strong>not allowed</strong> to use/<strong><code>import</code></strong> any libraries other than <code>math</code> (and the built in integration tool is not allowed either).</p>
  
  <p>Any idea how I should go about it? When I wrote the program, I always get <code>x</code> is undefined, but if I define <code>x</code> as a value ( lets say 0 ) then the <code>2*x+3</code> part in the parameters is always taken as a value instead of a math equation, so I can't really use it inside?</p>
  
  <p>It would be very helpful, not just to this assignment, but many in the future if I know how a python function can take a math equation as parameter, so thanks alot.</p>