title: Cumulative integration of elements of numpy arrays
body: <p>I would like to to the following type of integration:</p>
  
  <p>Say I have 2 arrays</p>
  
  <pre><code>a = np.array[1,2,3,4]
  b = np.array[2,4,6,8]
  </code></pre>
  
  <p>I know how to integrate these using something like:</p>
  
  <pre><code>c = scipy.integrate.simps(b, a)
  </code></pre>
  
  <p>where <code>c = 15</code> for above data set.</p>
  
  <p>What I would like to do is multiply the first elements of each array and add to new array called <code>d</code>, i.e. <code>a[0]*b[0]</code> then integrate the first 2 elements the arrays then the first 3 elements, etc. So eventually for this data set, I would get</p>
  
  <pre><code>d = [2 3 8 15]
  </code></pre>
  
  <p>I have tried a few things but no luck; I am pretty new to writing code.</p>