Analyzing the Setup
Imagine you are standing on a path that stretches from −10 to 10. You are looking at a function f(x) that behaves like a rhythmic, repeating pulse.
This function is defined by the greatest integer function, [x], which acts like a staircase. The rule for f(x) flips depending on whether [x] is odd or even, creating a symmetric zig-zag pattern that dances across the x-axis.
Our mission is to calculate the integral of this function multiplied by cos(πx) over the entire interval.
Decoding the Rhythm
First, let us look at the function f(x) in the interval [0,1). Here, [x]=0, which is even. The definition tells us f(x)=1+[x]−x, so f(x)=1−x.
Now, look at the next interval, [1,2). Here, [x]=1, which is odd. The definition changes to f(x)=x−[x], so f(x)=x−1.
If you sketch this, you see a line going down from 1 to 0, then a line going up from 0 to 1. By checking f(x+2), we confirm that this pattern repeats every 2 units. Thus, f(x) is periodic with period T=2.
The Power of Periodicity
Now, consider the integrand g(x)=f(x)cos(πx). We know f(x) has a period of 2, and the function cos(πx) also has a period of:
When two periodic functions with the same period are multiplied, their product is also periodic with that same period. This is a massive shortcut.
The integral of a periodic function over multiple periods is just the number of periods multiplied by the integral over one period. Our interval [−10,10] has a length of 20, which is exactly 10 periods of length 2.
The integral becomes:
When we multiply this by the 10π2 factor from the original problem, the 10s cancel out, leaving us with:
The Calculus Journey
We have reduced the problem to integrating over just one period, [0,2]. Because f(x) changes its definition at x=1, we must split the integral:
π2[∫01(1−x)cos(πx)dx+∫12(x−1)cos(πx)dx]
Let us call these J1 and J2. For J1=∫01(1−x)cos(πx)dx, we use integration by parts. We set u=1−x and dv=cos(πx)dx.
The boundary term vanishes because sin(π)=0 and sin(0)=0. We are left with:
∫01πsin(πx)dx=[−π2cos(πx)]01=π21−(−π21)=π22
For J2=∫12(x−1)cos(πx)dx, the process is identical. The boundary term vanishes again because sin(2π)=0 and sin(π)=0. The integral evaluates to π22.
The Grand Finale
We are almost there! We just need to sum our results:
π2(J1+J2)=π2(π22+π22)=π2(π24)
The π2 terms cancel out, and we are left with the clean, beautiful integer 4.
This problem teaches us that even the most intimidating integrals can be tamed by looking for symmetry and periodicity. Always pause, visualize the function, and let the properties of the math do the heavy lifting for you.