title: How to numerically integrate with infinite limit in MATLAB?
body: <p>I want to numerically integrate an integral with infinite limit. Does anyone have any idea how should I do that?</p>
  
  <p><code>int(x* exp (v*x + (1-exp(v*x))/v),x, o , inf)</code> does not work.</p>
  
  <p>Note that I will have values for <code>v</code>.</p>
  
  <pre><code>%n=10;
  kappa=.5;
  delta0=.5;
  Vmax=500;
  Vdep=2.2;
  l=2.2;
  kbT=4.1;
  %xb=.4;
  fb=10;
  k=1;
  V0=5;
  
  e1=(fb*l/kbT)*(kappa/delta0);
  e2=Vmax/V0;
  e3=Vdep/V0;
  
  w=zeros(1,25);
  
  for v=1:25
      w(:,v)=integral(@(x) x.*exp(v*x+((1-exp(v*x))/v)),0,inf);
  end
  
  e12=e2*exp(-e1*(1:25).*w.^2)-e3;
  plot(e12);
  ylim([0 25]);
  hold on;
  plot(0:25,0:25);
  xlim([0 25]);
  %hold off;
  </code></pre>
  
  <p>The plot is not matching the real data in the article!(for the e12 curve specially)
  I need to calculate the intersection of the 2 curves (which is ~13.8 based on the paper) and then in the second part I have to add a term in e12 which contains an independent variable:</p>
  
  <pre><code>v=13.8;
  w= integral(@(x) x.*exp(v*x+((1-exp(v*x))/v)),0,inf)
  e4 = zeros (1,180);
  fl = 1:180;
  e4(:,fl)= (fl*l/kbT)*(kappa/n);
  e12=e2*exp(-e1*v*w^2-e4)-e3
  </code></pre>
  
  <p>But again the problem is that running this code I will end with a negative value for e12 which  should be just approaching zero in large values of fl (fl>160)</p>
  
  <p>to show how this code is different from the expected curve you can plot these data on the same figure:</p>
  
  <pre><code>fl = [0, 1, 4, 9, 15, 20, 25, 40, 60, 80, 100, 120, 140, 160, 180];
  e12 = [66, 60, 50, 40, 30, 25.5, 20, 15.5, 10.5, 8.3, 6.6, 5, 2.25, 1.1, 0.5];
  </code></pre>
  
  <p>which obviously does not match the curve generated by the code.</p>