Question is revised as below:

I'm trying to define a function involving inverse of a Laplace Transform for a rational function, but Mathematica provides a wrong result. Can anyone help on this?

Here's the code:

beta1 = 1/15; beta2 = 1/10; w1 = 0.4;lambda=0.15;

f[y_, t_] := Exp[-lambda* t]*(Sum[(lambda* t)^n/(n!)*InverseLaplaceTransform[(w1*beta1/(beta1 + s) + (1 - w1)* beta2/(beta2 + s))^n, s, y], {n, 1, 20}]);

f[20,13] (*try to test the result*)


Mathematica 10 provides an answer of -0.0547458, which is incorrect as the value should be positive.

This function will be used in integration later on, which means that it will be called repeatedly. Why this is wrong here. Are there any other ways to define it?

• This is a question about InverseLaplaceTransform, but adding such a tag requires 300 reputations... – Tim Nov 11 '15 at 4:54
• With[{beta1 = 1/15, beta2 = 1/10, w1 = 2/5, n = 13, ya = 500}, InverseLaplaceTransform[(w1*beta1/(beta1 + s) + (1 - w1)*beta2/(beta2 + s))^n, s, y] /. y -> ya] // N gives your expected result. – J. M. will be back soon Nov 11 '15 at 5:18
• @J. M. Thank you very much for your reply! It works now, so I guess the issue comes from the unspecified n? The reason I code using a function is that I will need to add n from 1 to N (for a large N). Now I simply sum "n" without defining yn[y_,n_] and the result is correct. – Tim Nov 11 '15 at 6:27
• @J.M. Would you please help on the question further? Eventually I need: f[y_, t_] := Exp[-lambda* t]*(Sum[(lambdat)^n/(n!) InverseLaplaceTransform[(w1*beta1/(beta1 + s) + (1 - w1)* beta2/(beta2 + s))^n, s, y], {n, 1, 20}]); It will be used for integration later on; For small values, it works. But I found that for larger t, it still provide inaccurate value. e.g. f[20,13] shows a negative value. Is there an alternative way to define the function?, Ideally, I could get an symbolic inversed expression, since it will be repeatedly called during integration. – Tim Nov 11 '15 at 6:53
• If you want to extend your question please edit the question itself. add there any extra questions, data or context. – rhermans Nov 11 '15 at 8:02