1
$\begingroup$

I have the following integral to compute

$$ \int_{-\infty}^{A} \frac{1}{(4 \pi)} \Big[ \text{erf}\Big(\frac{k M - x + 2 \pi}{\sqrt{2} k S}\Big) - \text{erf}\Big(\frac{k M - x}{\sqrt{2} k S}\Big) \Big] dx $$

Where $\text{erf}$ is the error function. Mathematica does compute the indefinite integral, but not the definite one like this. If I see the indefinite integral, it looks like that at $-\infty$, the function is not converging. However, looking at the function, I feel at $-\infty$, the integrand of this must be $0$.

The indefinite integral from Mathematica:

$$\frac{1}{4\pi} \Bigg[ \left(k M-x\right) \text{erf}\left(\frac{k \mu_{\omega}-x}{\sqrt{2} k S}\right) \\ +\left(-k M+x-2 \pi \right) \text{erf}\left(\frac{k M-x+2 \pi }{\sqrt{2} k S}\right)+\sqrt{\frac{2}{\pi }} k S \left(e^{-\frac{\left(x-k M\right)^2}{2 k^2 S^2}}-e^{-\frac{\left(k M-x+2 \pi \right)^2}{2 k^2 S^2}}\right) \Bigg] $$

================== EDIT based on – user293787's comment:

I am trying the following input:

L[x_]  := 1/(4 Pi) ( 
   Erf[(k M - x + 2 Pi)/(Sqrt[2] k S)] -  Erf[(k M - x )/(Sqrt[2] k S)] )

Integrate[L[x], {x, -Infinity, A}]
$\endgroup$
2
  • 2
    $\begingroup$ The definite integral Integrate[Erf[2*Pi-x]-Erf[-x],{x,-Infinity,A}] is evaluated immediately. Please provide the code that does not return a result, you may just have created confusion with all your constants and simply need the appropriate Assumptions. $\endgroup$
    – user293787
    Aug 11, 2022 at 7:57
  • $\begingroup$ I have edited the question with the code! $\endgroup$
    – CfourPiO
    Aug 11, 2022 at 10:01

1 Answer 1

1
$\begingroup$

OP probably has information about k and S that should be conveyed to Mathematica via Assumptions. This will make it easier for Integrate to decide, for example, if an integral converges or not.

Two examples:

  • If k and S are both positive, one can use:
Integrate[L[x],{x,-Infinity,A},
          Assumptions->{k>0,S>0}]
  • If k and S are real and nonzero, one can use:
Integrate[L[x],{x,-Infinity,A},
          Assumptions->{Element[k|S,Reals],k!=0,S!=0}]

Both these Integrate are evaluated explicitly and give a result in terms of Erf.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you for the answer. I was looking for this. This solved my issue. For me, S was non negative real number and k an integer greater than 0. I used these assumptions. $\endgroup$
    – CfourPiO
    Aug 11, 2022 at 10:27

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.