SetDirectory[StringJoin[$HomeDirectory,"/Documents/handouts/math467/GammaBessel"]]

Gamma Function

Plot[Gamma[x],{x,-5,5},Exclusions->Range[-5,0],ExclusionsStyle->Dashed,AxesLabel->{"\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["x", "TI"], TraditionalForm], "errors" -> {}, "input" -> "$x$", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{"Γ", "(", 
StyleBox["x", "TI"], ")"}], TraditionalForm], "errors" -> {}, "input" -> "\\Gamma(x)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},BaseStyle->FontSize->12]

Export["gammafunction.pdf",%,"PDF"]

Export["gammafunction.eps",%%,"EPS"]

Bessel Functions

Plot[Evaluate[Table[BesselJ[p,x],{p,0,2,1/2}]],{x,0,10},AxesLabel->{"x","y"},PlotLegends->Table[(Subscript[J, p])"(x)",{p,0,2,1/2}]]

Export["besseljs.eps",%,"EPS"]

Export["besseljs.pdf",%%,"PDF"]

Plot[Evaluate[Table[BesselY[p,x],{p,0,2,1/2}]],{x,0,10},AxesLabel->{"x","y"},PlotLegends->{"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
SubscriptBox[
StyleBox["Y", "TI"], "0"], "(", 
StyleBox["x", "TI"], ")"}], TraditionalForm], "errors" -> {}, "input" -> "Y_{0}(x)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
SubscriptBox[
StyleBox["Y", "TI"], 
RowBox[{"1", "/", "2"}]], "(", 
StyleBox["x", "TI"], ")"}], TraditionalForm], "errors" -> {}, "input" -> "Y_{1/2}(x)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
SubscriptBox[
StyleBox["Y", "TI"], "1"], "(", 
StyleBox["x", "TI"], ")"}], TraditionalForm], "errors" -> {}, "input" -> "Y_{1}(x)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
SubscriptBox[
StyleBox["Y", "TI"], 
RowBox[{"3", "/", "2"}]], "(", 
StyleBox["x", "TI"], ")"}], TraditionalForm], "errors" -> {}, "input" -> "Y_{3/2}(x)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
SubscriptBox[
StyleBox["Y", "TI"], "2"], "(", 
StyleBox["x", "TI"], ")"}], TraditionalForm], "errors" -> {}, "input" -> "Y_{2}(x)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"}]

Export["besselys.eps",%,"EPS"]

Export["besselys.pdf",%%,"PDF"]

Bessel Series Example

f[x_]:=1-x

a[n_Integer]:=2Integrate[f[z]BesselJ[0,BesselJZero[0,n]z]z,{z,0,1}]/((((BesselJ[1,BesselJZero[0,n]]))^2))

a[1]//N

coeffs=Table[N[a[n]],{n,1,5}]

eigfuns=Table[BesselJ[0,BesselJZero[0,k]x],{k,1,5}]

S[n_Integer][x_]:=Take[coeffs,n].Take[eigfuns,n]

S[5][x]

S[1][x]

S[3][x]

Plot[{f[x],S[1][x],S[3][x],S[5][x]},{x,0,1},AxesLabel->{"x","y"},PlotTheme->{"Detailed","Monochrome"},Frame->False,GridLines->False,Axes->Automatic,PlotLegends->{"f(x)","(Subscript[S, 1])(x)","(Subscript[S, 3])(x)","(Subscript[S, 5])(x)"}]

Plot[{f[x],S[1][x],S[3][x],S[5][x]},{x,0,1},AxesLabel->{"\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["x", "TI"], TraditionalForm], "errors" -> {}, "input" -> "x", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["y", "TI"], TraditionalForm], "errors" -> {}, "input" -> "y", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},PlotTheme->{"Monochrome"},AspectRatio->1/2,BaseStyle->FontSize->12]

Export["besselseries.eps",%,"EPS"]

Export["besselseries.pdf",%%,"PDF"]