- Understand the function on each unit interval
For any integer n, on the interval [n,n+1) we have [x]=n.
So
f(x)={x−n,1+n−x,n odd,n even.
Thus on each unit interval, f(x) is a triangular/sawtooth function.
- Break the integral into unit intervals
We need to compute
I=∫−1010f(x)cos(πx)dx.
Write it as
I=n=−10∑9∫nn+1f(x)cos(πx)dx.
Now let x=n+t, where t∈[0,1). Then dx=dt and
cos(πx)=cos(π(n+t))=cos(nπ+πt)=(−1)ncos(πt).
Also,
- if n is odd, then f(x)=t,
- if n is even, then f(x)=1−t.
So the contribution from interval [n,n+1) is
In=∫01gn(t)(−1)ncos(πt)dt,
where
gn(t)={t,1−t,n odd,n even.
- Show every interval gives the same integral
If n is even, then (−1)n=1, so
In=∫01(1−t)cos(πt)dt.
If n is odd, then (−1)n=−1, so
In=−∫01tcos(πt)dt.
Now compute
∫01(1−t)cos(πt)dt=∫01cos(πt)dt−∫01tcos(πt)dt.
But
∫01cos(πt)dt=[πsin(πt)]01=0.
Hence
∫01(1−t)cos(πt)dt=−∫01tcos(πt)dt.
So both even and odd cases are equal. Therefore every interval contributes the same value
J=∫01(1−t)cos(πt)dt.
There are 20 unit intervals from −10 to 10, so
I=20J.
- Compute J
We evaluate
J=∫01(1−t)cos(πt)dt.
Integrate by parts for
∫01tcos(πt)dt.
Let
u=t,dv=cos(πt)dt.
Then
du=dt,v=πsin(πt).
Thus
∫01tcos(πt)dt=[πtsin(πt)]01−π1∫01sin(πt)dt.
The boundary term is 0, so
∫01tcos(πt)dt=−π1[−πcos(πt)]01=−π21(−cosπ+cos0).
Since cosπ=−1 and cos0=1,
∫01tcos(πt)dt=−π21(1+1)=−π22.
Therefore
J=−∫01tcos(πt)dt=π22.
Hence
I=20⋅π22=π240.
- Compute the required value
We need
10π2∫−1010f(x)cos(πx)dx=10π2⋅π240=4.
- Final answer
The required integer is
4.
This matches the stored correct answer.