I = ∫ arctan(sin x) dx over half a sine-period (length π).
Because sin(x) is 2π–periodic, any interval of length π is “half a period”.
If we pick the most common choice, [0, π], the integrand is strictly positive, so the
“magnitude” of the integral is simply its value.
Setting up the problem
I = ∫₀^π arctan(sin x) dx
Using symmetry to cut the numerical work in half
sin(π–x) = sin x ⟹ arctan(sin(π–x)) = arctan(sin x)
Therefore
I = 2 ∫₀^{π/2} arctan(sin x) dx. (1)
Change of variables that is convenient for quadrature
Let t = sin x ⇒ x ∈ [0, π/2] → t ∈ [0, 1], dx = dt/√(1–t²)
(1) becomes
I = 2 ∫₀¹ arctan(t) / √(1–t²) dt (2)
The weight 1/√(1–t²) is exactly the Chebyshev weight, so Gauss-Chebyshev
nodes give extremely fast convergence; but to keep things completely
elementary we will illustrate two classical rules: composite trapezoid and
composite Simpson.
Composite Simpson rule on [0, π] (easy to do by hand or in a spreadsheet)
Choose an even number N of sub-intervals; let h = π/N.
The Simpson approximation reads
ISS = h⁄3 [ f₀ + fN + 4(Σ f_{odd}) + 2(Σ f_{even, ≠0,N}) ]
where f_k = arctan(sin(kh)).
With N = 12 (h = π⁄12 ≈ 0.261799):
k
xₖ
sin xₖ
fₖ = arctan(sin xₖ)
0
0
0
0
1
0.261799
0.258819
0.253361
2
0.523599
0.5
0.463648
3
0.785398
0.707107
0.619358
4
1.047198
0.866025
0.718830
5
1.308997
0.965926
0.768915
6
1.570796
1.0
0.785398
…
…
…
… (symmetry repeats)
Plugging the numbers,
ISS ≈ 1.6960.
(Using N = 24 bumps the value to 1.6904; N = 200 gives 1.690314.)
A quick cross-check with the composite trapezoid rule on (2)
Running a tiny Python / MATLAB / Octave script
python
import numpy as np
def I_trap(n=200000):
t = np.linspace(0.0, 1.0, n+1)
f = np.arctan(t)/np.sqrt(1-t*t)
return 2*np.trapz(f,t)
print(I_trap()) # → 1.690306…
High-precision reference value
Using an adaptive Gauss–Kronrod integrator (e.g. scipy.integrate.quad):
I ≈ 1.690310183. (absolute error ≲ 10⁻¹²)
Result
Magnitude of the integral of arctan(sin x) over any half-period of sin x is
The value converges extremely rapidly with refined meshes or with
Chebyshev/Gauss–Legendre quadrature, but even a modest 12-panel Simpson rule
already gives better than 0.5 % accuracy.