Cotangent

Author

Eric W. Weisstein
March 3, 2010

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/Cotangent.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Cotangent.html.

©2010 Wolfram Research, Inc. except for portions noted otherwise

Definition

TrigToExp[Cot[z]]

Simplify[%]

Plots

<<Utilities`Plot`

Real Axis

PlotDiscontinuous[Cot[x],{x,Sequence@@(Range[-2,2]Pi)},PlotRange->{Automatic,{-5,5}},
VerticalAsymptotes->Range[-2,2]Pi,
Ticks->{{#,TraditionalForm[#]}&/@Range[-2Pi,2Pi,Pi],Automatic},AxesLabel->TraditionalForm/@{x,Cot[x]}]

Complex Plane

ComplexPlot3D[Cot[z],{z,-2Pi,2Pi},PlotPoints->100,ClipFill->None,Mesh->False]//Timing

ComplexContourPlot[Cot[z],{z,-5,5}]//Timing

Fixed Point

Plot[{Cot[x],x},{x,-5,5}]

V8

Solve[Cot[x] == x, x, Reals]

Reduce[Cot[x]==x,x,Reals]

Reduce[Cot[x]==x&&0<x<10,x,Reals]

FindInstance[Cot[x]==x,x, Reals]

FindInstance[Cot[x]==x&&0<x<2,x, Reals]

Series

Plus@@Table[(((((-1))^n)(2^(2n))BernoulliB[2n])/((2n)!))(z^(2n-1)),{n,0,10}]//TraditionalForm

Series[Cot[z],{z,0,20}]//TraditionalForm

CoefficientList[%-1/z,z]

Through[{Numerator,Denominator}[Last/@Partition[%,2]]]

Analytic Form of terms

V5

<<DiscreteMath`RSolve`

FullSimplify[SeriesTerm[Cot[z],{z,0,n}]]

V7

InputForm[ser=SeriesCoefficient[Cot[z],{z,0,n}]]

Table[%,{n,-1,10}]

TimeConstrained[GeneratingFunction[ser,n,x],60]//Timing

Sums

2 x (∑_n^∞)(1/((x^2)-(n^2)))+(1/x)==π cot(π x)

V6

FullSimplify[(1/x)+2x Sum[(1/((x^2)-(n^2))),{n,∞}]]

V7

(1/x)+2x Sum[(1/((x^2)-(n^2))),{n,∞}]

FullSimplify[%]

(∑_(n=-1)^∞)(((x^n) (i (((2 i))^n) ((Subscript[B, n+1])+(Subscript[B, n+1])(1))))/(Γ(n+2)))==cot(x)

Sum[((I (((2 I))^n) (BernoulliB[1+n]+BernoulliB[1+n,1]))/(Gamma[2+n]))(x^n),{n,-1,∞}]//InputForm

Sum[((I (((2 I))^n) (BernoulliB[1+n]+BernoulliB[1+n,1]))/(Gamma[2+n]))(x^n),{n,-1,100}]/.x->1.3

Cot[1.3]

(∑_(n=-1)^∞)(((x^n) (i (((2 i))^n) (2 (Subscript[B, n+1])+(Subscript[δ, n]))))/(Γ(n+2)))==cot(x)

FullSimplify[((I (((2 I))^n) (BernoulliB[1+n]+BernoulliB[1+n,1]))/(Gamma[2+n]))]

Sum[((I (((2 I))^n) (2 BernoulliB[1+n]+KroneckerDelta[n]))/(Gamma[2+n])),{n,-1,∞}]

Sum[((I (((2 I))^n) (2 BernoulliB[1+n]+KroneckerDelta[n]))/(Gamma[2+n]))x^n,{n,-1,∞}]//InputForm

Sum[((I (((2 I))^n) (2 BernoulliB[1+n]+KroneckerDelta[n]))/(Gamma[2+n]))x^n,{n,-1,100}]/.x->1.3

Cot[1.3]

(∑_(n=0)^∞)(((z^(2 n-1)) ((((-1))^n) (2^(2 n)) (Subscript[B, 2 n])))/((2 n)!))==cot(z)

Sum[(((((-1))^n)(2^(2n))BernoulliB[2n])/((2n)!))(z^(2n-1)),{n,0,∞}]//InputForm

Sum[(((((-1))^n)(2^(2n))BernoulliB[2n])/((2n)!))(z^(2n-1)),{n,0,100}]/.z->1.3

Cot[1.3]

(∑_(n=-∞)^∞)Piecewise[(({{1, n==-1}, {-((i (((2 i))^n) (-1+(((-1))^n)) (Subscript[B, n+1]))/((n+1)!)), n≥0}}))(x^n),0]==cot(x)

SeriesCoefficient[Cot[x],{x,0,n}]

InputForm[%]

TimeConstrained[Sum[Piecewise[{{1,n==-1},{((-I)*(2*I)^n*(-1+(-1)^n)*BernoulliB[1+n])/(1+n)!,n≥0}},0] x^n,{n,-∞,∞}],60]//Timing

Sum[Piecewise[{{1,n==-1},{((-I)*(2*I)^n*(-1+(-1)^n)*BernoulliB[1+n])/(1+n)!,n≥0}},0] x^n,{n,-1,100}]/.{x->1.3}

Cot[1.3]

Derivative and Integral

Derivative

D[Cot[z],z]

Indefinite Integral

Integrate[Cot[z],z]

Definite Integrals

<<Utilities`Simplify`

(∫_(π/4)^(π/2))cot(x)dx

Integrate[Cot[x],{x,π/4,π/2}]

(∫_0^(π/4)) (cot^n)(x)dx

Integrate[Cot[x]^n,{x,0,π/4}]

i=Integrate[Cot[x]^n,{x,0,π/4},Assumptions->n<1]

Table[i,{n,-5,-2}]//FunctionExpand

(∫_0^(π/2)) (cot^n)(x)dx

Integrate[Cot[x]^n,{x,0,π/2}]//Timing

Integrate[Cot[x]^n,{x,0,π/2},Assumptions->-1<Re[n]<1]//Timing

(∫_0^(π/4))log(cot(x))dx

Integrate[Log[Cot[x]],{x,0,π/4}]//Timing

(∫_0^(π/4))x cot(x)dx

Integrate[x Cot[x],{x,0,π/4}]

(∫_0^(π/2))x cot(x)dx

Integrate[x Cot[x],{x,0,π/2}]

(∫_(π/4)^(π/2))x cot(x)dx

Integrate[x Cot[x],{x,π/4,π/2}]//LogExpand

(∫_0^(π/4))(x^2) cot(x)dx

Integrate[x^2 Cot[x],{x,0,π/4}]//LogExpand

(∫_0^(π/2))(x^2) cot(x)dx

Integrate[x^2 Cot[x],{x,0,π/2}]//LogExpand

(∫_0^(π/4))(x^n) cot(x)dx

Integrate[x^n Cot[x],{x,0,π/4}]//Timing

Algebraic Degree of cot((π/n))

l={1,2,1,4,2,6,2,6,4,10,2,12,6,8,4,16,6,18,4,12,10,22,4,20,12,18,6,28,8,30,8,20,16,24,6,36,18,24,8,40,12,42,10,24,22,47,8,42,20,32,12};

<<Utilities`Plot`

Show[PixelPerfect[BasePlot[l],BlockSize->4]]

1+Length[l]

RootReduce[FunctionExpand[Cot[Pi/40]]]

RootReduce[FunctionExpand[Cot[Pi/48]]]

Do[
Print[{n,Timing[r=RootReduce[TrigToExp[Cot[Pi/n]]]],
Switch[r,
_Integer,1,
_Root,Exponent[r[[1]][x],x],
_,2]}],
{n,39,40}]

Do[
Print[{n,Timing[r=RootReduce[RootReduce/@Together[TrigToExp[Cot[Pi/n]]]]],
Switch[r,
_Integer,1,
_Root,Exponent[r[[1]][x],x],
_,2]}],
{n,41,52}]