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

Example 02

Integrate[π-θ,{θ,-π,π}]/π

Integrate[(π-θ)Cos[n θ],{θ,-π,π}]/π/.Sin[n π]->0

Integrate[(π-θ)Sin[n θ],{θ,-π,π}]/π/.{Sin[n π]->0,Cos[n π]->(((-1))^n)}

Simplify[-1/2+1/(1-r Exp[I(θ-t)]/a)]

u[r_,θ_]:=π-2ArcTan[r Sin[θ]/(1+r Cos[θ])]

D[u[r,θ],r,r]+D[u[r,θ],r]/r+D[u[r,θ],θ,θ]/(r^2)//Simplify

v[x_,y_]:=u[Sqrt[(x^2)+(y^2)],ArcTan[x,y]]

ContourPlot[v[x,y],{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y},(x^2)+(y^2)≤1],FrameLabel->{"x","y"},ContourLabels->All,Contours->9,PlotTheme->"Detailed"]

DensityPlot[v[x,y],{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y},(x^2)+(y^2)≤1],FrameLabel->{"x","y"},PlotTheme->"Detailed"]

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

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

Example 03

Integrate[Sin[2m θ]Sin[2n θ],{θ,0,π/2},Assumptions->{m∈Integers,n∈Integers,n≠m}]/.{Sin[n π]->0, Sin[m π]->0,Cos[m π]->(((-1))^m),Cos[n π]->(((-1))^n)}

Integrate[Sin[2m θ]Sin[2n θ],{θ,0,π/2},Assumptions->{m∈Integers,n∈Integers,n==m}]/.Sin[2n π]->0

Integrate[θ(π/2-θ)Sin[2m θ],{θ,0,π/2}]/.{Cos[m π]->(((-1))^m),Sin[m π]->0}

Simplify[%]

Solve[{a+b==1,a/4+4b==2/π}]

Solve[{a+b==0,(2^(-2(2k+1)))a+(2^(2(2k+1)))b==2/(π(((2k+1))^3))},{a,b}]

soln=First[NDSolve[{D[v[r,θ],r,r]+D[v[r,θ],r]/r+D[v[r,θ],θ,θ]/(r^2)==0,v[r,0]==0,v[r,π/2]==0,v[1,θ]==Sin[2θ],v[2,θ]==θ(π/2-θ)},v,{r,1,2},{θ,0,π/2}]]

DensityPlot[v[Sqrt[(x^2)+(y^2)],ArcTan[x,y]]/.soln,{x,0,2},{y,0,2},RegionFunction->Function[{x,y},1<(x^2)+(y^2)<4],FrameLabel->{"x","y"},PlotTheme->"Detailed"]

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

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