I am trying to integrate Abs|E^ $\sin \theta$| (the absolute value of Euler's constant to the power of sin(theta), and tried the code Integrate[Abs[E^Sin[x]], x] but it returned as \[Integral]E^Re[Sin[x]] \[DifferentialD]x

Could someone please show me how to correctly integrate the function? Thanks, and sorry in advance for the corrections you would have to make to this post!

  • $\begingroup$ I am sure the antiderivative under consideration has no closed-form expression. Think of the function NIntegrate[Abs[E^Sin[t]], {t, 0, x}]. $\endgroup$ – user64494 May 27 '19 at 3:49
  • $\begingroup$ Or better, to make @user64494's point more clear: Plot[NIntegrate[RealAbs[E^Sin[x]], {x, -10, t}],{t, -10, 10}] $\endgroup$ – b3m2a1 May 27 '19 at 3:52
  • $\begingroup$ thanks for your clarification, @b3m2a1 $\endgroup$ – wendy May 27 '19 at 9:38
  • $\begingroup$ thank you for your advice, @user64494 ! $\endgroup$ – wendy May 27 '19 at 9:39

Check this numerical treatment:

g[t_] := Abs[E^Sin[t]]
nsol = Table[NIntegrate[g[t], {t, 0, x}], {x, -10, 10, .1}]; 
f[x_] = Interpolation[Thread@{Table[x, {x, -10, 10, .1}], nsol}, x]
Plot[f[x], {x, -1, 1}]

Now this f[x] can be used in further calculations!

enter image description here

Let's check the obtained interpolated function f(x) is correct or not!

 NIntegrate[g[t], {t, -10, 10}]  = 25.0755
 f[10] - f[-10]                  = 25.0755 

Hope This helps!

| improve this answer | |
  • $\begingroup$ it does, @Sachin Kumar ! Thanks so much for ur help $\endgroup$ – wendy May 27 '19 at 9:36
  • 1
    $\begingroup$ @wendy, Good that it has helped you, Pl accept the answer. $\endgroup$ – 2.0 May 27 '19 at 9:42
  • 1
    $\begingroup$ Better to use FunctionInterpolation. It'll be smarter about how it chooses points and the tests I've run suggest it's about four times as accurate as this method. Also it's faster. If you want to stick with Interpolation, at the very least it makes sense to create the grid of points and the interpolated values in the same Table call. $\endgroup$ – b3m2a1 May 27 '19 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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