Consider the function $\csc(t)\sin(3t)$ on the interval $[0,\pi]$. This is a perfectly well-behaved smooth function, as can be seen when plotting it:
Plot[2 Csc[t] Sin[3 t], {t, 0, π}]
so why cannot I not numerically integrate it by running the following?
NIntegrate[2 Csc[t] Sin[3 t], {t, 0, π}]
Instead I get the error message "NIntegrate::errprec: Catastrophic loss of precision in the global error estimate due to insufficient WorkingPrecision or divergent integral". FYI I expect the answer to be $2\pi$, as can be seen by running
Integrate[2 Csc[t] Sin[3 t], {t, 0, π}]
Thanks in advance for any help.
Csc[t]). Following the advice in the error message, try it wthWorkingPrecision -> 16. – Michael E2 Nov 27 '21 at 19:25NIntegrate[2 Csc[t] Sin[3 t] // TrigExpand, {t, 0, \[Pi]}]– Michael E2 Nov 27 '21 at 19:34NIntegrateselects a bad rule (Clenshaw-Curtis osciilatory). TryNIntegrate[2 Csc[t] Sin[3 t], {t, 0, \[Pi]}, Method -> "GaussKronrodRule"]– Michael E2 Nov 27 '21 at 19:43Integraterather thanNIntegrate– Bob Hanlon Nov 27 '21 at 20:39NIntegrate[2 ChebyshevU[2, Cos[t]], {t, 0, π}]– J. M.'s missing motivation Dec 09 '21 at 20:31TrigExpandto the Integrand. – Michael Seifert Dec 09 '21 at 20:40