MATLAB: How tontegrate this function

integration

I used the following matlab code to integrate f equation as follows:
syms v C sigma v0
f=((exp(-C*v)))*(1/(sigma*(pi/2)^0.5*erfc(-v0/(2^0.5*sigma))))*(exp(-(-((v-v0)^2)/(2*sigma^2))));
int(f,v,[0 inf])
to get this previously reported answer:
f=(erfc((-1/2^0.5)*((v0/sigma)-(C*sigma))))/(erfc((-1/2^0.5)*(v0/sigma)))*exp((-C*v0)+(0.5*sigma^2*C^2));
However, I get this, which is not correct:
ans =
-(4503599627370496*((2^(1/2)*pi^(1/2)*exp(- (C^2*sigma^2)/2 - v0*C)*limit(erf((2^(1/2)*(((C*sigma^2 + v0)*1i)/sigma^2 - (v*1i)/sigma^2))/(2*(1/sigma^2)^(1/2))), v, Inf)*1i)/(2*(1/sigma^2)^(1/2)) - (2^(1/2)*pi^(1/2)*exp(- (C^2*sigma^2)/2 - v0*C)*erf((2^(1/2)*(C*sigma^2 + v0)*1i)/(2*sigma^2*(1/sigma^2)^(1/2)))*1i)/(2*(1/sigma^2)^(1/2))))/(5644425081792261*sigma*(erfc((2^(1/2)*v0)/(2*sigma)) - 2))
Would you please help me on this?

Best Answer

The "previously reported answer" is incorrect, and MATLAB's answer is correct. The integral is infinite if C and sigma are nonnegative.
It appears to me that the "previously reported answer" might have been calculated by Maple. It appears to be to be a bug in Maple, which I will report to Maplesoft.
If you are using Maple, then if you substitute numeric values for v0, sigma, and C and then do the integration over 0 to infinity, then you will get infinity as the output; whereas in Maple when the bug is in effect if you integrate over v and then substitute in numeric values you will get a finite symbolic solution. It looks to me as if that finite solution that you obtain might be the integral from 0 to 1. If you do the same thing bug integrate from 1 to infinity in Maple you will get infinity -- and since the integral from 0 to 1 is finite and non-negative, the whole integral must be infinite.