Let the sought area be tn. For the values n=0,1,2, plotting the function fn (Figure 1), we can see that t0=0, t1=1, t2=7, and with the notation an=n(n+1)/2, the following statement is true for n=0,1,2:
if if if x≤−an, then fn(x)=−x−an−an<x<an, then 0<fn(x)≤nan≤x, then fn(x)=x−an
!
Since an−an−1=n and fn(x)=∣fn−1(x)−n∣, if statement (1) is true for (n−1), then it is also true for n (Figure 2). Therefore, by the principle of mathematical induction, (1) holds for all n. Based on Figure 2, the area tn is obtained by subtracting the area of the region bounded by the curve of the function fn between points E and F and the segment EF from the area of the trapezoid ADFE. This is nothing more than the reflection of the curve of fn−1 between points B and C over the line y=n/2, so the area to be subtracted is exactly tn−1. The area of the trapezoid is
BE2AD+EF=n(an+an−1)=n3
thus tn=n3−tn−1. Writing this relationship for n replaced by (n−1),(n−2),… and adding them with alternating signs, we get that for even n,
tn=n3−(n−1)3+(n−2)3+…+23−13
and for odd n,
tn=n3−(n−1)3+(n−2)3+…−23+13
since t0=0. This solves the problem.
Remark. For tn, not only the expressions in (2) and (3), but also a closed form can be given. For this, we start from the following identity:
8n3=[4n3+6n2−1]+[4(n−1)3+6(n−1)2−1]
Comparing this with the relationship 8n3=8tn+8tn−1, we get that the sum of consecutive terms of the sequence 8tn−[4n3+6n2−1](n=0,1,2,…) is 0, and since the value of the expression 8tn−4n3+6n2−1 is +1 for n=0, the terms of the sequence alternate between +1 and -1. From this, we get that 8tn−[4n3+6n2−1]=(−1)n, so
tn=84n3+6n2−1+(−1)n