Weierstrass Function

Author

Eric W. Weisstein
January 10, 2009

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

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

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

Initialization

WeierstrassFunction[a_,x_]:=Sum[Sin[Pi k^a x]/(Pi k^a),{k,250}]

Plots

<<Utilities`Typesetting`

V5

Plot[Evaluate[Table[WeierstrassFunction[a,x],{a,2,4}]],{x,0,1},PlotStyle->{Red,Green,Blue},
AxesLabel->TraditionalForm/@{x,Sum[InlineFraction[Sin[Pi k^a x],(Pi k^a)],{k,∞}]}]//Timing

V6

Plot[Evaluate[Table[WeierstrassFunction[a,x],{a,2,4}]],{x,0,1},PlotStyle->{Red,Green,Blue},
AxesLabel->{x,HoldForm[Sum[Sin[Pi k^a x]/(Pi k^a),{k,1,∞}]]}]

Sums

(∑_k^∞)((sin(π x (k^a)))/(π (k^a)))

Sum[Sin[Pi k^2 x]/(Pi k^2),{k,∞}]

Sum[Sin[Pi k^a x]/(Pi k^a),{k,∞},Assumptions->a>0]//Timing

(∑_(k=1)^∞)((sin(((π (k^2) p)/q)))/(π (k^2)))==(π/(4 (q^2))) (∑_(i=1)^(q-1))((sin(((π (i^2) p)/q)))/((sin^2)(((π i)/(2 q)))))

WeierstrassFunction[r_Rational]:=Module[{i,p=Numerator[r],q=Denominator[r]},
Pi/(4q^2) Sum[Sin[i^2 p Pi/q]/Sin[i Pi/(2q)]^2,{i,q-1}]
]

Pi/(4q^2) Sum[Sin[i^2 p Pi/q]/Sin[i Pi/(2q)]^2,{i,q-1},Assumptions->0<p<q<1]

ListPlot[Sort[Flatten[Table[{p/q,WeierstrassFunction[p/q]},{p,30},{q,p+1,30}],1],Less[#1[[1]],#2[[1]]]&],PlotJoined->True,
PlotStyle->Red]