f[θ_, 
        n_] := (Binomial[n, 
            n/2] ((θ + π/2)/π)^(n/
                2) ((π/2 - θ)/π)^(n/
                2) )