Well, I've to find the RMS (root mean square) over all time of the following function:
In the picture I plotted a case where I used values for components in the full bridge rectifier with capacitor filter but I want to solve the general case.
From $0\le t\le\frac{1}{4f}$ the function that describes the waveform is:
$$\left|u\sin\left(2\pi ft\right)\right|\tag1$$
When the sine wave is at its top, the function turn into a exponential function (because the capacitor discharges):
$$u\exp\left(-\frac{t}{\tau}\right)\tag2$$
The point where the sine wave returns is:
$$\left|u\sin\left(2\pi ft\right)\right|=u\exp\left(-\frac{t}{\tau}\right)\space\Longleftrightarrow\space t:=T=\dots\tag3$$
Where $\frac{1}{2f}<T<\frac{3}{4f}$
And then the proces starts over again: the exponential function comes back when the sine wave is at its top.
Now, I need to find the RMS over all time so I wrote:
$$\lim_{\text{n}\to\infty}\sqrt{\frac{1}{\text{n}}\int_0^\text{n}\left(\text{y}\left(t\right)\right)^2\space\text{d}t}\tag4$$
And in order to find $\int_0^\text{n}\left(\text{y}\left(t\right)\right)^2\space\text{d}t$ I wrote:
$$\int_0^\text{n}\left(\text{y}\left(t\right)\right)^2\space\text{d}t\stackrel{?}{=}\int_0^\frac{1}{4f}\left(\left|u\sin\left(2\pi ft\right)\right|\right)^2\space\text{d}t+\text{n}\cdot\int_0^T\left(u\exp\left(-\frac{t}{\tau}\right)\right)^2\space\text{d}t+\text{n}\cdot\int_T^\frac{3}{4f}\left(\left|u\sin\left(2\pi ft\right)\right|\right)^2\space\text{d}t\tag5$$
The question is, am I right and how do I proceed?

You are calculating an integral $$\lim_{n\rightarrow\infty}\sqrt{\frac{1}{n}\int_0^n y(t)^2 dt}$$ But your $y(t)$ is periodic aside from a transient phenomenon $$y(t)=\left\{\begin{matrix}y_{\text{transient}}(t) & t <T_0 \\ y_{\text{periodic}}(t-T_0) & T_0<t<T_0+P \\ y_{\text{periodic}}(t-(T_0+P)) & T_0+P<t<T_0+2P \\ \vdots\end{matrix}\right.$$ So the original integral becomes $$\lim_{n\rightarrow\infty}\sqrt{\frac{1}{n}\int_0^n y(t)^2 dt}=\lim_{n\rightarrow\infty}\sqrt{\underbrace{\frac{1}{n}\int_0^{T_0} y_{\text{transient}}(t)^2 dt}_{\rightarrow 0\text{ as }n\rightarrow\infty} + \frac{1}{n}\int_{T_0}^{n} y(t)^2 dt}$$ what remains is periodic.