6

I am trying to find the numerical value of $$\int_{-\pi}^\pi \sin(2\cos\theta)\cos(4\theta)\,d\theta$$.

The integrand looks like a nice, continuous function that is finite, bounded, differentiable, etc. Furthermore, I am just looking for a numerical value, not the exact antiderivative.

However, upon trying out first with WolframAlpha and Sage, none are able to give a satisfactory numerical value.

WolframAlpha ran out of computation time, and Sage gave an answer of order $10^{-17}$ with an error of order $10^{-15}$, i.e. the error is larger than the answer itself.

I am not an expert in numerical analysis, so I am puzzled at why this happened?

Any help will be greatly appreciated. Thanks.

Bonus: If anyone can tell me what is the numerical value (just accurate to 3 significant figures will be enough), I will upvote and accept your answer gratefully.

yoyostein
  • 19,608
  • 15
    $10^{-17}$ with an error of $10^{-15}$ suggests to me that it equals $0.$ – Doug M Sep 03 '16 at 04:08
  • @Moo Which software did you use to get that? – yoyostein Sep 03 '16 at 04:11
  • Mathematica will give you an answer that is satisfactory to any precision you choose. – ReverseFlowControl Sep 03 '16 at 04:15
  • 1
    WolframAlpha swiftly returns and says zero. You must have made a typo. –  Sep 03 '16 at 08:59
  • 1
    W|A gives the answer for me just fine https://www.wolframalpha.com/input/?i=integral+of+sin(2cos(x))cos(4x)+from+-pi+to+pi – Wojowu Sep 03 '16 at 09:25
  • 2
    If you want a quick and dirty way to suppress Mathematica's "help I can't integrate this", just add a constant to the integrand and subtract it at the end. NIntegrate[Sin[2 Cos[t]] Cos[4 t] + 1, {t, -Pi, Pi}] - 2 Pi – Patrick Stevens Sep 03 '16 at 10:57
  • 1
    I launched WolframAlpha with NIntegrate[Sin[2 Cos[t]] Cos[4 t], {t, -Pi, Pi}], the answer was shown almost immediately. The analytical version Integrate[Sin[2 Cos[t]] Cos[4 t], {t, -Pi, Pi}] is also quite fast to show the resulting zero. I do not know where the problem comes from - either bad internet connection, or a quick bugfix on server side (doubt that). – TZakrevskiy Sep 03 '16 at 19:34

2 Answers2

27

The integrand $f(\theta):=\sin(2\cos\theta)\cos(4\theta)$ is an even function: $f(-\theta)=f(\theta)$. So the integral of $f$ over the interval $[-\pi,\pi]$ is double its value over $[0,\pi]$. However, check also that $$f\left(\frac\pi2+t\right)=-f\left(\frac\pi2-t\right),$$ i.e. the integrand has odd symmetry around the point $(\pi/2,0)$. Hence the integral equals zero.

grand_chat
  • 38,951
  • 9
    Nice. Triumph of human over machine. – yoyostein Sep 03 '16 at 04:19
  • 19
    @yoyostein: A lot of triumphs of human over machine are merely examples of "The computer did what you asked it to, not what you wanted it to". –  Sep 03 '16 at 09:02
17

The graph of the function makes it obvious:enter image description here

  • It doesn't quite. We are all used to odd functions integrating to zero. But this one becomes odd only if moved by $\pi/2$. So at the first glance the graph makes it even stranger, not obvious. – Ruslan Sep 04 '16 at 12:17
  • 1
    I meant the regions above and below the X axis are identical. –  Sep 04 '16 at 13:00