title: Integrate a function and specify other parameters in r
body: <p>Let's say I want to integrate the function </p>
  
  <pre><code>integrand &lt;- function(x, a) exp(a*x)
  </code></pre>
  
  <p>where <code>x</code> is my covariate and <code>a</code> is simply a number specified by the user. How do I integrate this in <strong>R</strong>? I know you can do something like:</p>
  
  <pre><code>integrand &lt;- function(x) {1/((x+1)*sqrt(x))}
  integrate(integrand, lower = 0, upper = Inf)
  </code></pre>
  
  <p>But how can I supply other parameters? I am thinking that I probably need some kind of <code>expression</code> or <code>eval</code> function, but I am not sure how to implement it.</p>