1
$\begingroup$

We have a function as

e[t_] :=(E^(-t^2)) Cos[0.1 t]

and we must evaluate below integration (However I used the variable x here, I just want to calculate the integration and x is a local variable)

a[t_] := Integrate[e[x], {x, 0, t}]

the final results is a[t]. That it will be of the form:

(0. + 2.91163*10^-40 I) (1. Erfi[9.68227 - (0. + 0.00294353 I) t] -   1. Erfi[9.68227 + (0. + 0.00294353 I) t])

As it shown, in this result, Error function will appear. But we have to use of a[t] in next our calculation. Actually, we have to evaluate the p[t_, \[Tau]_]:=Integrate[a[x],{x,t-\[Tau],t}] .

For this reason we should have a more clear form of a[t] In which there should be no error function. How can we receive the a[t] in the absence of Error function? Are there any way to get rid of it?

$\endgroup$
2
  • 2
    $\begingroup$ The error function is a standard higher transcendental function, so it should be considered a "clear form." Further it cannot be written in terms of elementary functions. Unless the error functions cancel each other out (there are identities after all), I do not see how you are going to get rid of it. $\endgroup$
    – Michael E2
    Commented Dec 21, 2014 at 14:39
  • $\begingroup$ You are right, It is completely rational. The problem was not aroused of Error Function, it was related to some negligible imaginary parts. $\endgroup$ Commented Dec 21, 2014 at 15:18

1 Answer 1

5
$\begingroup$

It is unclear why you believe that there is a problem with the presence of the error function in a[t].

e[t_] = E^(-t^2) Cos[t/10];

a[t_] = Integrate[e[x], {x, 0, t}];

a[t] is readily integrated

 p[t_, tau_] = Integrate[a[x], {x, t - tau, t}]

(1/(80*E^(1/400)))* (20*(E^(1/20 - It)^2 + E^(1/20 + It)^2 - E^(1/20 + I*(t - tau))^2 - E^(1/20 - It + Itau)^2) + Sqrt[Pi]*((-1 + 20*It) Erfi[1/20 - I*t] + (-1 - 20*I*t)Erfi[ 1/20 + It] + (1 + 20*I*t - 20*Itau) Erfi[1/20 + I*(t - tau)] + (1 - 20*I*t + 20*Itau) Erfi[1/20 - It + Itau]))

p[t, tau] can be evaluated. Chop can be used to remove any negligible imaginary component due to numerical noise.

p[2., 1.]

0.8408887255235893 + 0.*I

% // Chop

0.840889

Table[
  {t, tau, p[t, tau] // Chop},
  {t, -4., 4., 2.}, {tau, -4., 4., 2.}] //
 Flatten[#, 1] &

{{-4., -4., 3.03855}, {-4., -2., 1.76719}, {-4., 0., 0}, {-4., 2., -1.76803}, {-4., 4., -3.53606}, {-2., -4., 0}, {-2., -2., 1.27137}, {-2., 0., 0}, {-2., 2., -1.76719}, {-2., 4., -3.53521}, {0., -4., -3.03855}, {0., -2., -1.27137}, {0., 0., 0}, {0., 2., -1.27137}, {0., 4., -3.03855}, {2., -4., -3.53521}, {2., -2., -1.76719}, {2., 0., 0}, {2., 2., 1.27137}, {2., 4., 0}, {4., -4., -3.53606}, {4., -2., -1.76803}, {4., 0., 0}, {4., 2., 1.76719}, {4., 4., 3.03855}}

p[t, tau] can also be readily plotted.

Plot3D[p[t, tau], {t, -10, 10}, {tau, -10, 10},
 AxesLabel -> (Style[#, 14, Bold] & /@
    {"t", "tau", "p(t, tau)"})]

enter image description here

As expected from looking at the plot

p[t, tau] == p[-t, -tau] // Simplify

True

$\endgroup$
7
  • $\begingroup$ +1. But I think the 0. I is not from numerical noise, but because the numerical type used in the computation is a machine/floating-point Complex, which is displayed with + 0. I when the imaginary part is zero. $\endgroup$
    – Michael E2
    Commented Dec 21, 2014 at 14:45
  • $\begingroup$ OK. Thanks a bunch. I think I had not recognized that the source of the problem. Maybe it arouses of imaginary part of the function. I think 'chop' will help. $\endgroup$ Commented Dec 21, 2014 at 15:13
  • $\begingroup$ If there has been remained a little question but there would be not a suitable space in this comment place, How can be asked? $\endgroup$ Commented Dec 23, 2014 at 5:37
  • $\begingroup$ Initiate a new question, just make sure that it differs from the one above. $\endgroup$
    – Bob Hanlon
    Commented Dec 23, 2014 at 5:45
  • $\begingroup$ Approximately, it needs to the above information. As a matter of fact, I have to use 'p' in other calculations. It means 'p' must be as a parameter not directly as a numeric. the final step is just an integration of a function of 'p' and 'a' (Which is absent here). Every thing is ok with 'p' and 'a'. But that Integration (containing functions of 'p' and 'a') will be gotten stuck. I so much tried to find what is the problem but I could not find any answer or key! Moreover, I can't understand should I substitute CHOP in a very step to the final or should I do that just to the final step? $\endgroup$ Commented Dec 23, 2014 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.