α0[N_,x_]:= (1/N)((Sin[((N x)/2)])/(Tan[(x/2)]))/;Mod[N,2]==0
α0[N_,x_]:= (1/N)((Sin[((N x)/2)])/(Sin[(x/2)]))/;Mod[N,2]==1
β0[N_, x_]:=(1/(2π))-(1/4)Cos[N(( x)/2)]+(1/N)Sum[((n Cos[n x])/(Sin[((n π)/N)])),{n,1,(N/2)}]/;Mod[N,2]==0
β0[N_, x_]:=(1/(2π))+(1/N)Sum[((n Cos[n x])/(Sin[((n π)/N)])),{n,1,((N-1)/2)}]/;Mod[N,2]==1
α[N_,n_,x_]:=α0[N, x-n ((2π)/N)];
β[N_,n_,x_]:=β0[N, x-n((2π)/N)];
γ[N_,k_]:=(1/(2 N))-((((-1))^k)/(2 N))+(1/N)Sum[Csc[((n π)/N)] (Sin[(((1-2 k) n π)/N)]+Sin[((2 k n π)/N)]),{n,1,(N/2)}]/;Mod[N,2]==0
γ[N_,k_]:=(1/(2 N))+(1/N)Sum[Csc[((n π)/N)] (Sin[(((1-2 k) n π)/N)]+Sin[((2 k n π)/N)]),{n,1,((N-1)/2)}]/;Mod[N,2]==1

δ[N_, n_, x_]:=((((N-1))^2)α[2N-2,0,x]+(1/2)Cos[(N-1)x])Sin[x]
ρ[N_, n_, x_]:=2γ[2N-2,n]δ[N, n, x]+2γ[2N-2,N-n-1]δ[N, n, π-x]

{n,k}
h = ((2π)/N);
FullSimplify[
Integrate[((n Cos[n( x-h k)])/(Sin[((n π)/N)])), {x, 0, (1/2)h} ], {k∈Integers, n∈Integers, n<N}]
(*FullSimplify[
Integrate[{(1/(2π)),(1/4)Cos[N(( (x-n h))/2)],(1/N)((n Cos[n (x-n h)])/(Sin[((n π)/N)]))}, {x, π, π-(1/2)h} ], {((N+1)/2)∈Integers, n∈Integers, n<N}]*)

κ0[N_, n_, x_]:=α[2N-2, n,x]/;n==0
κ0[N_, n_, x_]:=α[2N-2, n,x]/;n==N-1
κ0[N_, n_, x_]:=α[2N-2, n,x]+ α[2N-2,2 N-2-n, x];
κ1[N_, n_, x_]:=(β[2N-2, n+(1/2),x]-β[2N-2, 2N-3-n+(1/2),x]);
κd0[N_, n_, x_]:=α[2N-2, n+(1/2),x]+ α[2N-2, 2N-3-n+(1/2), x];
κd1[N_, n_, x_]:=δ[N,n,x]/;n==0
κd1[N_, n_, x_]:=δ[N,n,π-x]/;n==N-1
κd1[N_, n_, x_]:=(β[2N-2,n,x]-β[2N-2,2N-2-n,x]-ρ[N,n,x]);
{0,(1/4)π,(1/2)π,(3/4)π,π}

Limit[κ0[3,1,x],x-> 0]
Limit[κ0[3,1,x],x-> (1/2)π]
Limit[κ0[3,1,x],x-> π]

Limit[κd0[3,1,x],x-> (π/4)]
Limit[κd0[3,1,x],x-> ((3π)/4)]

Integrate[κ1[3, 0, x],  {x,0,π/2}]
Integrate[κ1[3, 0, x],  {x,π/2,π}]

ψ0[N_, n_, x_]:=κ0[N, n, ArcCos[-x]];
ψ1[N_, n_, x_]:=κ1[N, n, ArcCos[-x]](1/(√(1-(x^2))));
ψd0[N_, n_, x_]:=κd0[N, n, ArcCos[-x]];
ψd1[N_, n_, x_]:=κd1[N, n, ArcCos[-x]](1/(√(1-(x^2))));
{Cos[(4/4)π],Cos[(5/4)π], Cos[(6/4)π],Cos[(7/4)π],Cos[(8/4)π]}

Limit[ψ0[3,1,x],x-> -1]
Limit[ψ0[3,1,x],x-> 0]
Limit[ψ0[3,1,x],x-> +1]

Limit[ψd0[3,1,x],x-> -(1/(Sqrt[2]))]
Limit[ψd0[3,1,x],x-> (1/(Sqrt[2]))]

Integrate[ψ1[3, 1, x],  {x,-1,0}]
Integrate[ψ1[3, 1, x],  {x,0,1}]

Integrate[ψd1[3, 2, x],  {x,-1,-(1/(Sqrt[2]))}]
Integrate[ψd1[3, 2, x],  {x,-(1/(√2)),(1/(Sqrt[2]))}]
Integrate[ψd1[3,2,x], {x,  (1/(Sqrt[2])),1}]

FullSimplify[Series[ψ0[2, n, x],{x,0,10}], Element[n, Integers]]
FullSimplify[Series[ψ1[2, n, x],{x,0,10}], Element[n, Integers]]
FullSimplify[Series[ψd0[2, n, x],{x,0,10}], Element[n, Integers]]
FullSimplify[Series[ψd1[2, n, x],{x,0,10}], Element[n, Integers]]

FullSimplify[Series[ψ0[2, 0, x],{x,0,10}]]
FullSimplify[Series[ψ0[2, 1, x],{x,0,10}]]
FullSimplify[Series[ψ1[2, 0, x],{x,0,10}]]
FullSimplify[Series[ψd0[2, 0, x],{x,0,10}]]
FullSimplify[Series[ψd1[2, 0, x],{x,0,10}]]
FullSimplify[Series[ψd1[2, 1, x],{x,0,10}]]

FullSimplify[Series[ψ0[3, 0, x],{x,0,10}]]
FullSimplify[Series[ψ0[3, 1, x],{x,0,10}]]
FullSimplify[Series[ψ0[3, 2, x],{x,0,10}]]
FullSimplify[Series[ψ1[3, 0, x],{x,0,10}]]
FullSimplify[Series[ψ1[3, 1, x],{x,0,10}]]
FullSimplify[Series[ψd0[3, 0, x],{x,0,10}]]
FullSimplify[Series[ψd0[3, 1, x],{x,0,10}]]
FullSimplify[Series[ψd1[3, 0, x],{x,0,10}]]
FullSimplify[Series[ψd1[3, 1, x],{x,0,10}]]
FullSimplify[Series[ψd1[3, 2, x],{x,0,10}]]

FullSimplify[Series[ψ0[4, 0, x],{x,0,10}]]
FullSimplify[Series[ψ0[4, 1, x],{x,0,10}]]
FullSimplify[Series[ψ0[4, 2, x],{x,0,10}]]
FullSimplify[Series[ψ0[4, 3, x],{x,0,10}]]
FullSimplify[Series[ψ1[4, 0, x],{x,0,10}]]
FullSimplify[Series[ψ1[4, 1, x],{x,0,10}]]
FullSimplify[Series[ψ1[4, 2, x],{x,0,10}]]
FullSimplify[Series[ψd0[4, 0, x],{x,0,10}]]
FullSimplify[Series[ψd0[4, 1, x],{x,0,10}]]
FullSimplify[Series[ψd0[4, 2, x],{x,0,10}]]
FullSimplify[Series[ψd1[4, 0, x],{x,0,10}]]
FullSimplify[Series[ψd1[4, 1, x],{x,0,10}]]
FullSimplify[Series[ψd1[4, 2, x],{x,0,10}]]
FullSimplify[Series[ψd1[4, 3, x],{x,0,10}]]