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

2 Answers 2

27
$\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$
2
  • 9
    $\begingroup$ Nice. Triumph of human over machine. $\endgroup$
    – yoyostein
    Commented Sep 3, 2016 at 4:19
  • 19
    $\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
    Commented Sep 3, 2016 at 9:02
17
$\begingroup$

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .