Hi,
The definition is to integrate over the period and then divide by the period. Anything else is an approximation. Integrating isnt particularly hard to do for this wave because all the terms are sin terms which integrate easily. We can however do the integration using an approximate method too if you prefer.
The result is not 2 volts and is not 1.95 volts so something must have went wrong when you did those calculations.
The result is 2 volts if the wave was a perfect square wave with amplitude 2v peak (4v peak to peak), but we have an approximate square wave here not a true one. I am using the original 'b' values you posted in the first post.
The result comes out to 1.9014 to 5 significant figures, but you should do this yourself too and get more digits. I did this using two methods, one analytical and the other completely numerical and the results agree out to something like 14 decimal places.
To prove this graphically, you could draw the wave positive portion using a high resolution graphics function drawing program, and also draw a perfect square wave (positive portion) that exactly encloses the approximate wave touching at the highest peaks. Since we know the area of the perfect square wave is equal to the base width times the height and we know the length and height of one pixel, we can calculate the exact number of pixels under the perfect square wave and we can count the number of pixels under the approximate wave. We can then divide the counted pixels by the calculated pixels and come out with a ratio that when multiplied by the average value of the perfect square wave yields the the average value of the approximate wave.
To do this mathematically using an approximate integral, we can divide the time axis of the true square wave into sections of equal length and sum all of those lengths. Then do the same for the approx square wave. The average value of the approx square wave is then the ratio of the sum using the approx wave divided by the sum using the true square wave times the average value of the true square wave (which is 2.000000). Try this and see what you get.
The integral of:
B*sin(N*w*t)
is:
-B*cos(N*w*t)/(N*w)
so you could use that to integrate term by term if you like. This works out to:
B*(1/(N*w)-cos((N*w*T)/2)/(N*w))
for the integral of B*sin(N*w*t) over the period from 0 to T/2, so you could use that to make it simple for each term.
Slightly simpler form is:
B*(1-cos((N*w*T)/2))/(N*w)
where N=1,3,5 or 7.
After dividing by T/2, we get:
2*B*(1-cos(pi*f*N*T))/(2*pi*f*N*T)
and because T is related to f this simplifies even more to:
B*(1-cos(pi*N))/(pi*N)
and because cos(pi*N) for N odd always results in a value of -1, we get:
B*(1-(-1))/(pi*N)
which simplifies to:
2*B/(pi*N)
for each term with N=1,3,5, and 7.
So applying that term by term and summing should provide the same results for the average value.