Let α=sin−1x and β=cos−1x. Using α+β=2π:
f(x)=α2+β2=α2+(2π−α)2=2α2−πα+4π2
This equals 2(α−4π)2+8π2, which is minimized at α=4π.
For x∈[−23,21], we have α∈[−3π,4π].
Distance from −3π to vertex: 4π+3π=127π. Distance from 4π to vertex: 0.
Maximum occurs at x=−23 where α=−3π:
f(−23)=2(9π2)+3π2+4π2=π2(368+12+9)=3629π2
Since gcd(29,36)=1, we have m=29,n=36, so m+n=65