RMS value of trapeziodal fourier series I calculated RMS value of trapezoidal fourier series but the numerical results are not same with its normal formula.
$b_n = \frac{8\cdot A}{\pi \cdot u \cdot n^2}\cdot sin(\frac{n \cdot u}{ 2})$
$f_{rms} = \sqrt{ a_0^2 + \frac{a_1^2 + a_2^2 +a_3^2+..... + b_1^2 + b_2^2 + b_3^2}{2}}$
$V_{rms,f} = \sqrt{\frac{8 \cdot A }{\pi \cdot u \cdot 2}(\frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2}.... \frac{1}{(2n-1)^2})}$
$\sum(2n-1)^2 = \frac{\pi^2}{8}$
$V_{rms,f} = \sqrt{\frac{A \cdot \pi}{u \cdot 2}}$
if $A = 12$ and $u = pi/6$, $V_{rms,f} = 6$
Normal RMS formula
$V_{rms} = A \cdot \sqrt{1-\frac{2 \cdot u}{3 \cdot \pi}}$
if $A = 12$ and $u = pi/6$, $V_{rms,f} = 11.313$
Where did I mistake ?
 A: Using Octave code similar to those in Shifted square wave Fourier series
format long;

A = 12;
u = pi / 6;

t = 0:0.0001:(2*pi);
n = (1:2:1000).';

fourier_bn = @(n) 8 .* A ./ (pi .* u .* n.^2) .* sin(n .* u ./ 2);
fourier_term = @(n) fourier_bn(n) .* sin(n .* t);
fourier = sum(cell2mat(arrayfun(fourier_term, n, 'UniformOutput', false)));

fourier_rms_discrete = sqrt(sum(fourier.^2) ./ length(t))
fourier_rms_1st = sqrt(sum(fourier_bn(n).^2) ./ 2)


We can see that both discrete approximation and the 1st formula gives us $V_{\text{rms}, f} = 11.313...$, which is the same as what you computed using the 2nd formula.
Therefore, the 2nd computation is correct, but the 1st one is wrong. It is wrong because
$$\begin{align}
f_{\text{rms}}
&= \sqrt{a_0^2 + \frac{a_1^2 + a_2^2 + a_3^2 + \dots + b_1^2 + b_2^2 + b_3^2 + \dots}{2}} \\
&= \sqrt{\frac{b_1^2 + b_2^2 + b_3^2 + \dots}{2}} \\
&= \sqrt{\frac{\left(\frac{8A}{\pi u 1^2} \sin \frac{1u}{2} \right)^2 + \left(\frac{8A}{\pi u 2^2} \sin \frac{2u}{2} \right)^2 + \left(\frac{8A}{\pi u 3^2} \sin \frac{3u}{2} \right)^2 + \dots}{2}} \\
&= \sqrt{\frac{\left(\frac{8A}{\pi u}\right)^2 \left(\left(\frac{\sin \frac{1u}{2}}{1^2}\right)^2 + \left(\frac{\sin \frac{2u}{2}}{2^2}\right)^2 + \left(\frac{\sin \frac{3u}{2}}{3^2}\right)^2 + \dots\right)}{2}} \\
&= \sqrt{\left(\frac{8A}{\sqrt{2} \pi u}\right)^2 \left(\left(\frac{\sin \frac{1u}{2}}{1^2}\right)^2 + \left(\frac{\sin \frac{2u}{2}}{2^2}\right)^2 + \left(\frac{\sin \frac{3u}{2}}{3^2}\right)^2 + \dots\right)} \\
&= \frac{8A}{\sqrt{2} \pi u} \sqrt{\frac{\sin^2 \frac{1u}{2}}{1^4} + \frac{\sin^2 \frac{2u}{2}}{2^4} + \frac{\sin^2 \frac{3u}{2}}{3^4} + \dots}
\end{align}$$
Clearly,
$$\frac{8A}{\sqrt{2} \pi u} \sqrt{\frac{\sin^2 \frac{1u}{2}}{1^4} + \frac{\sin^2 \frac{2u}{2}}{2^4} + \frac{\sin^2 \frac{3u}{2}}{3^4} + \dots} \ne \sqrt{\frac{A \pi}{u 2}}$$
because at $u = 2\pi, A = 1$ we have $\text{LHS} = 0$ but $\text{RHS} > 0$.
