title: How numerically solve an complex integral using the MATLAB
body: <p>I'm trying to solve this equation:</p>
  
  <p><strong>K=sqrt((R*T)/(4*pi*lambda))*integral from -inf to inf of exp(-((lambda+F*neta)/R*T-x)^2*R*T/4*lambda)/exp(x)+1 with regard to x</strong></p>
  
  <p>where, neta is an interval from 0 to 1 and the others symbols (R, T, F, lambda and pi) have constant values.</p>
  
  <p>I tried to use these codes:</p>
  
  <p>code 1</p>
  
  <pre><code>clear all;
  close all;
  clc;
  F = 96485.34;
  R = 8.3145;
  T = 298.15;
  lambda = 0.2;
  neta=0:0.1:1;
  pi=3.1415;
  f=@(x) exp(-((lambda+F*neta)/R*T-x).^2*R*T/4*lambda)/(exp(x)+1);
  Q=integral(f,-inf,inf);
  k= sqrt((R*T)/(4*pi*lambda)).*Q
  </code></pre>
  
  <p>code 2</p>
  
  <pre><code>clear all;
  close all;
  clc;
  F = 96485.34;
  R = 8.3145;
  T = 298.15;
  lambda = 0.2;
  neta=0:0.1:1;
  pi=3.1415;
  x= 0:100;
  f(x)=exp(-((lambda+F*neta)/R*T-x).^2*R*T/4*lambda)/(exp(x)+1);
  q=quadl('f', 0, 100);
  k= sqrt((R*T)/(4*pi*lambda)).*q
  </code></pre>
  
  <p>but these codes return errors that I do not know to solve.
  Can someone help me, please?</p>
  
  <p>thanks</p>