3
$\begingroup$

Let us consider

int = Integrate[ArcSin[Sin[n*x]], {x, 0, 1}, Assumptions -> n > 10]

-((17 \[Pi]^2)/(4 n)) + ArcSin[Sin[n]] - 1/2 n Abs[Cos[n]] Sec[n]

This result is not correct in view of the discordance between

N[int/.n->55/2]

12.999

and

Integrate[ArcSin[Sin[55/2*x]], {x, 0, 1}] // N

0.078822

Let us correctly calculate the integral under consideration. As

n = 55/2; Plot[ArcSin[Sin[n*x]], {x, 0, 1}]

enter image description here

shows, the integrand has Floor[n/2/Pi] complete waves of the length 2*Pi/n on the interval and one incomplete wave if n/2/Pi is not integer. It is clear that the integrals of the integrand over the complete waves equal zero. Therefore, it is enough to calculate

ClearAll[n];res = Integrate[ArcSin[Sin[n*x]], {x, Floor[n/2/Pi]*2*Pi/n, 1}, Assumptions -> n > 10]

-((17 \[Pi]^2)/(4 n)) + ArcSin[Sin[n]] + (2 \[Pi]^2 Floor[n/(2 \[Pi])]^2)/n - 1/2 n Abs[Cos[n]] Sec[n]

, but res is not correct in view of

N[res /. n -> 55/2]

24.4837

, whereas

n = 55/2; Integrate[ArcSin[Sin[n*x]], {x, Floor[n/2/Pi]*2*Pi/n, 1}] // N

0.078822

Fortunately, there is a workaround. We write down ArcSin[Sin[x]] as Piecewise[{{x, x >= 0 && x <= Pi/2}, {Pi - x, x >= Pi/2 && x <= 3*Pi/2}, {x - 2*Pi, x >= 3*Pi/2 && x <= 2*Pi}}] on the interval $[0,2\pi]$. Then

ClearAll[n];res1=Integrate[Piecewise[{{n*x, n*x >= 0 && n*x <= Pi/2}, {Pi - n*x, 
n*x >= Pi/2 && n*x <= 3*Pi/2}, {n*x - 2*Pi, n*x >= 3*Pi/2 && n*x <= 2*Pi}}],
{x, 0, 1 - Floor[n/2/Pi]*2*Pi/n},  Assumptions -> n > 10]

Piecewise[{{Pi^2/(8*n), (n - 2*Pi*Floor[n/(2*Pi)] == Pi/2 && n > 10) || (n - 2*Pi*Floor[n/(2*Pi)] == (3*Pi)/2 && n > 10)}, {(n - 2*Pi*Floor[n/(2*Pi)])^2/ (2*n), Inequality[0, Less, n - 2*Pi*Floor[n/(2*Pi)], Less, Pi/2] && n > 10}, {(-2*n^2 + 4*n*Pi - Pi^2 + 8*n*Pi*Floor[n/(2*Pi)] - 8*Pi^2*Floor[n/(2*Pi)] - 8*Pi^2*Floor[n/(2*Pi)]^2)/ (4*n), Inequality[Pi/2, Less, n - 2*Pi*Floor[n/(2*Pi)], Less, (3*Pi)/2] && n > 10}, {(n^2 - 4*n*Pi + 4*Pi^2 - 4*n*Pi*Floor[n/(2*Pi)] + 8*Pi^2*Floor[n/(2*Pi)] + 4*Pi^2*Floor[n/(2*Pi)]^2)/ (2*n), Inequality[(3*Pi)/2, Less, n - 2*Pi*Floor[ n/(2*Pi)], Less, 2*Pi] && n > 10}}, 0]

and

N[res1 /. n -> 55/2]

0.078822

confirms its correctness. Unfortunately, Limit[res1,n->Infinity] returns the input instead of the expected result 0. Is there a way to simplify res1 or/and to derive another workaround?

$\endgroup$
5
  • 5
    $\begingroup$ This reads like a bug report (pending confirmation of its correctness) and it should be reported to Wolfram Support, not here. I find that just adding "Is there a workaround?" at the end does not quite make this into an appropriate question. $\endgroup$
    – MarcoB
    Commented Nov 18, 2021 at 18:14
  • $\begingroup$ @MarcoB: Did you read the question before having posted your comment? A workaround is presented by me, but I ask for a better one. Don't hesitate to ask for further explanation in need. Your constructive suggestions are welcome. $\endgroup$
    – user64494
    Commented Nov 18, 2021 at 18:21
  • $\begingroup$ I did read the question. The ultimate and most preferable solution to the problem you highlighted would be for Wolfram to fix or improve the internals of Integrate, so everybody could benefit from it. That is why I think it would be best for you to report the issue to Wolfram Support, at least in addition to discussing this question. $\endgroup$
    – MarcoB
    Commented Nov 18, 2021 at 23:56
  • $\begingroup$ @MarcoB: I did it. $\endgroup$
    – user64494
    Commented Nov 19, 2021 at 7:04
  • $\begingroup$ Great, thank you! $\endgroup$
    – MarcoB
    Commented Nov 19, 2021 at 15:56

1 Answer 1

2
$\begingroup$
Clear["Global`*"]

$Version

(* "12.3.1 for Mac OS X x86 (64-bit) (June 19, 2021)" *)

Use TrigToExp

int = Assuming[n > 10,
  Integrate[ArcSin[Sin[n*x]] // TrigToExp, {x, 0, 1}] // 
    ComplexExpand[#, TargetFunctions -> {Re, Im}] & // Simplify]

(* (1/(4 n))(π^2 + 2 Abs[Cos[n]] ArcTan[Abs[Cos[n]], Sin[n]]^2 Sec[n]) *)

int /. n -> 55/2 // Simplify

(* -(55/4) + 9 π - (161 π^2)/110 *)

% // N

(* 0.078822 *)

EDIT:

The integral is not a continuous function. For the limits the direction must be specified

{limFB = Limit[int, n -> 21 Pi/2, 
  Direction -> "FromBelow"], limFB // N}

(* {π/28, 0.1122} *)

{limFA = Limit[int, n -> 21 Pi/2, 
  Direction -> "FromAbove"], limFA // N}

(* {π/84, 0.0373999} *)

Plot[Evaluate@int, {n, 10, 50},
 PlotPoints -> 100,
 MaxRecursion -> 5,
 Exclusions -> ((2 # + 1) Pi/2 & /@ Range[3, 15]),
 ExclusionsStyle -> 
   Directive[Red, AbsoluteThickness[1], Dashed],
 Epilog -> {Red, AbsolutePointSize[4],
   Tooltip[Point[{21 Pi/2, #}], #] & /@ {limFB, limFA}}]

enter image description here

$\endgroup$
3
  • $\begingroup$ +1. Thank you. TrigToExp is strong and sure unexpected. Unfortunately, both (\[Pi]^2 - 2 Abs[Cos[n]] Log[Abs[Cos[n]] + I Sin[n]]^2 Sec[n])/( 4 n) /. n -> 10*Pi + Pi/2 and Limit[(\[Pi]^2 - 2 Abs[Cos[n]] Log[Abs[Cos[n]] + I Sin[n]]^2 Sec[n])/( 4 n), n -> 10*Pi + Pi/2] produce Indeterminate. Hope this gap can be removed. $\endgroup$
    – user64494
    Commented Nov 18, 2021 at 19:35
  • $\begingroup$ Of course, the same issue with (1/(4 n))(π^2 + 2 Abs[Cos[n]] ArcTan[Abs[Cos[n]], Sin[n]]^2 Sec[n]). $\endgroup$
    – user64494
    Commented Nov 18, 2021 at 20:01
  • 3
    $\begingroup$ Just wander about the graph, how can an integral of continuous function be discontinuous? $\endgroup$
    – yarchik
    Commented Nov 19, 2021 at 2:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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