6
$\begingroup$

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.

$\endgroup$
  • 15
    $\begingroup$ $10^{-17}$ with an error of $10^{-15}$ suggests to me that it equals $0.$ $\endgroup$ – Doug M Sep 3 '16 at 4:08
  • 1
    $\begingroup$ WolframAlpha swiftly returns and says zero. You must have made a typo. $\endgroup$ – user14972 Sep 3 '16 at 8:59
  • 1
    $\begingroup$ W|A gives the answer for me just fine wolframalpha.com/input/… $\endgroup$ – Wojowu Sep 3 '16 at 9:25
  • 2
    $\begingroup$ 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 $\endgroup$ – Patrick Stevens Sep 3 '16 at 10:57
  • 1
    $\begingroup$ 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). $\endgroup$ – TZakrevskiy Sep 3 '16 at 19:34
26
$\begingroup$

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.

$\endgroup$
  • 9
    $\begingroup$ Nice. Triumph of human over machine. $\endgroup$ – yoyostein Sep 3 '16 at 4:19
  • 18
    $\begingroup$ @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". $\endgroup$ – user14972 Sep 3 '16 at 9:02
17
$\begingroup$

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

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Ruslan Sep 4 '16 at 12:17
  • $\begingroup$ I meant the regions above and below the X axis are identical. $\endgroup$ – user348749 Sep 4 '16 at 13:00

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.