MATLAB: How to solve exponential distribution equation using symbolic Matlab

integrationsymbolicSymbolic Math Toolbox

I have exponential distribution function – F(tau) = beta * e^(-beta*tau). I need to integrate tau*F(tau) over the intervall 0 to inf, My answer should be 1/beta, however I don't get this answer. This is what I did:
>> syms tau beta
>> home
>> syms tau beta
>> f = tau*beta*exp(-beta*tau);
>> int(f, tau)
ans =
-(exp(-beta*tau)*(beta*tau + 1))/beta
Thanks for help, in advance.

Best Answer

It helps the int if you explicitly tells what the range to integrate over is:
int(f,0,inf)
HTH
Related Question