If $dS = S\mu dt + S \sigma(t) dW$, then we know that the implied volatility is $\int_0^T \sigma^2(s)/T \ ds$.
However, if $\sigma(t)$ is a piecewise constant function, i.e. constant between $T_1, T_2$ and between $T_2, T_3$, and so on.
Then, according to some lecture notes, the implied vols are
That, I don't quite understand. Where does this formula come from? If $T$ is the expiry, then how can there be a $T_{i+1} > T$? I thought the expiry was the final such $T$ value?