4.1.2 Polar coordinates

4.1.2.1 [305] Laplace PDE inside quarter disk, Neumann BC at edge
4.1.2.2 [306] \(r=4\) and \(u=x^4\) at boundary of disk
4.1.2.3 [307] \(r=1\) and \(u_r=x\) at boundary of disk
4.1.2.4 [308] Laplace inside disk. General solution
4.1.2.5 [309] Laplace inside disk. Specific boundary conditions
4.1.2.6 [310] Haberman 2.5.5 (c)
4.1.2.7 [311] semi-circle
4.1.2.8 [312] Haberman 2.5.8 (b)
4.1.2.9 [313] Circular annulus
4.1.2.10 [314] Outside a disk
4.1.2.11 [315] Outside a disk

4.1.2.1 [305] Laplace PDE inside quarter disk, Neumann BC at edge

problem number 305

Added December 20, 2018.

Example 20, Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

Solve Laplace equation in polar coordinates inside quarter disk with \(0<r<1\) and \(0<\theta <\frac {\pi }{2}\)

Solve for \(u\left ( r,\theta \right )\) \begin {align*} u_{rr} + \frac {1}{r} u_r + \frac {1}{r^2} u_{\theta \theta }=0 \end {align*}

Boundary conditions

\begin {align*} u(r,0) &= 0 \\ u(r,\frac {\pi }{2}) &=0 \\ u_r(1,\theta ) &= f(\theta ) \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta], {r, 2}] + (1*D[u[r, theta], r])/r + (1*D[u[r, theta], {theta, 2}])/r^2 == 0; 
 bcOnR = {Derivative[1, 0][u][1, theta] == f[theta]}; 
 bcOnTheta = {u[r, 0] == 0, u[r, Pi/2] == 0}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bcOnR, bcOnTheta}, u[r, theta], {r, theta}, Assumptions -> {r > 0, r < 1, theta > 0, theta < Pi/2}], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \underset {K[1]=1}{\overset {\infty }{\sum }}\frac {r^{2 K[1]} \left (\int _0^{\frac {\pi }{2}} \frac {2 f(\theta ) \sin (2 \theta K[1])}{\sqrt {\pi }} \, d\theta \right ) \sin (2 \theta K[1])}{\sqrt {\pi } K[1]}\right \}\right \}\]

Maple

restart; 
pde := diff(u(r, theta), r$2)+1/r* diff(u(r, theta), r)+1/r^2* diff(u(r, theta), theta$2)= 0; 
bc_on_theta:=u(r, 0) = 0, u(r,Pi/2) = 0; 
bc_on_r:= eval( diff(u(r,theta),r),r=1)=f(theta); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc_on_theta,bc_on_r], u(r, theta), HINT = boundedseries(r = [0])) assuming theta>0, theta < (1/2)*Pi, r>0, r < 1),output='realtime'));
 

\[u \left ( r,\theta \right ) =\sum _{n=1}^{\infty } \left ( 2\,{\frac {\int _{0}^{\pi /2}\!f \left ( \theta \right ) \sin \left ( 2\,n\theta \right ) \,{\rm d}\theta {r}^{2\,n}\sin \left ( 2\,n\theta \right ) }{\pi \,n}} \right ) \]

____________________________________________________________________________________

4.1.2.2 [306] \(r=4\) and \(u=x^4\) at boundary of disk

problem number 306

Added Nov 10, 2019.

Problem 4.3.25 part c. Peter J. Olver, Introduction to Partial Differential Equations, 2014 edition.

Solve Laplace equation in polar coordinates inside a disk

Solve \(\nabla ^{2}u=0\) with \(x^{2} +y^{2}<4\) and boundary conditions \(u=x^{4},x^{2}+y^{2}=4\).

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta], {r, 2}] + (D[u[r, theta], r])/r + (D[u[r, theta], {theta, 2}])/r^2 == 0; 
bc  = u[4, theta] == (4*Cos[theta])^4; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}], 60*10]]; 
sol =  sol /. K[1] -> n;
 

\[\left \{\left \{u(r,\theta )\to \frac {1}{8} r^4 \cos (4 \theta )+8 r^2 \cos (2 \theta )+96\right \}\right \}\]

Maple

restart; 
pde := diff(u(r, theta), r$2) + diff(u(r, theta), r)/r + diff(u(r, theta), theta$2)/r^2 = 0; 
bc  := u(4, theta) = (4*cos(theta))^4, u(r, -Pi) = u(r, Pi), (D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta))),output='realtime'));
 

\[u \left ( r,\theta \right ) =96+8\,{r}^{2}\cos \left ( 2\,\theta \right ) +1/8\,{r}^{4}\cos \left ( 4\,\theta \right ) \]

Hand solution

Solve the following boundary value problems \(\nabla ^{2}u=0,x^{2}+y^{2}<4,u=x^{4},x^{2}+y^{2}=4\)

Solution

In polar coordinates, where \(x=r\cos \theta ,y=r\sin \theta \), we need to solve for \(u\left ( r,\theta \right ) \) inside disk of radius \(r_{0}=4\). The Laplace PDE in polar coordinates is\begin {align*} u_{rr}+\frac {1}{r}u_{r}+\frac {1}{r^{2}}u_{\theta \theta } & =0\qquad 0<r<r_{0},-\pi <\theta <\pi \\ u\left ( r_{0},\theta \right ) & =f\left ( \theta \right ) =\left ( r_{0}\cos \theta \right ) ^{4}\\ u\left ( -\pi \right ) & =u\left ( \pi \right ) \\ u_{\theta }\left ( -\pi \right ) & =u_{\theta }\left ( \pi \right ) \end {align*}

Let the solution be\[ u\left ( r,\theta \right ) =R\left ( r\right ) \Theta \left ( \theta \right ) \] Substituting this assumed solution back into the (A) gives\[ r^{2}R^{\prime \prime }\Theta +rR^{\prime }\Theta +R\Theta ^{\prime \prime }=0 \] Dividing the above by \(R\Theta \) gives\begin {align*} r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R}+\frac {\Theta ^{\prime \prime }}{\Theta } & =0\\ r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R} & =-\frac {\Theta ^{\prime \prime }}{\Theta } \end {align*}

Since each side depends on different independent variable and they are equal, they must be equal to the same constant. say \(\lambda \). \[ r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R}=-\frac {\Theta ^{\prime \prime }}{\Theta }=\lambda \] This results in the following two ODE’s. The boundaries conditions in original PDE are transferred to each ODE which results in\begin {align} \Theta ^{\prime \prime }+\lambda \Theta & =0\tag {1}\\ \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \nonumber \\ \Theta ^{\prime }\left ( -\pi \right ) & =\Theta ^{\prime }\left ( \pi \right ) \nonumber \end {align}

And\begin {equation} r^{2}R^{\prime \prime }+rR^{\prime }-\lambda R=0\tag {2} \end {equation} Starting with ODE (1) with periodic boundary conditions.

Case \(\lambda <0\) The solution is\[ \Theta \left ( \theta \right ) =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) \] First B.C. gives\begin {align*} \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \\ A\cosh \left ( -\sqrt {\left \vert \lambda \right \vert }\pi \right ) +B\sinh \left ( -\sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) -B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ 2B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =0 \end {align*}

But \(\sinh =0\) only at zero and \(\lambda \neq 0\), hence \(B=0\) and the solution becomes\begin {align*} \Theta \left ( \theta \right ) & =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) \\ \Theta ^{\prime }\left ( \theta \right ) & =A\sqrt {\lambda }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) \end {align*}

Applying the second B.C. gives\begin {align*} \Theta ^{\prime }\left ( -\pi \right ) & =\Theta ^{\prime }\left ( \pi \right ) \\ A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( -\sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ 2A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =0 \end {align*}

But \(\cosh \) is never zero, hence \(A=0\). Therefore trivial solution and \(\lambda <0\) is not an eigenvalue.

Case \(\lambda =0\) The solution is \(\Theta =A\theta +B\). Applying the first B.C. gives\begin {align*} \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \\ -A\pi +B & =\pi A+B\\ 2\pi A & =0\\ A & =0 \end {align*}

And the solution becomes \(\Theta =B_{0}\). A constant. Hence \(\lambda =0\) is an eigenvalue.

Case \(\lambda >0\)

The solution becomes\begin {align*} \Theta & =A\cos \left ( \sqrt {\lambda }\theta \right ) +B\sin \left ( \sqrt {\lambda }\theta \right ) \\ \Theta ^{\prime } & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\theta \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\theta \right ) \end {align*}

Applying first B.C. gives\begin {align} \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \nonumber \\ A\cos \left ( -\sqrt {\lambda }\pi \right ) +B\sin \left ( -\sqrt {\lambda }\pi \right ) & =A\cos \left ( \sqrt {\lambda }\pi \right ) +B\sin \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ A\cos \left ( \sqrt {\lambda }\pi \right ) -B\sin \left ( \sqrt {\lambda }\pi \right ) & =A\cos \left ( \sqrt {\lambda }\pi \right ) +B\sin \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ 2B\sin \left ( \sqrt {\lambda }\pi \right ) & =0 \tag {3} \end {align}

Applying second B.C. gives\begin {align} \Theta ^{\prime }\left ( -\pi \right ) & =\Theta ^{\prime }\left ( \pi \right ) \nonumber \\ -A\sqrt {\lambda }\sin \left ( -\sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( -\sqrt {\lambda }\pi \right ) & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\pi \right ) & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ 2A\sin \left ( \sqrt {\lambda }\pi \right ) & =0 \tag {4} \end {align}

Equations (3,4) can be both zero only if \(A=B=0\) which gives trivial solution, or when \(\sin \left ( \sqrt {\lambda }\pi \right ) =0\). Therefore taking \(\sin \left ( \sqrt {\lambda }\pi \right ) =0\) gives a non-trivial solution. Hence\begin {align*} \sqrt {\lambda }\pi & =n\pi \qquad n=1,2,3,\cdots \\ \lambda _{n} & =n^{2}\qquad n=1,2,3,\cdots \end {align*}

Hence the eigenfunctions are \begin {equation} \{1,\cos \left ( n\theta \right ) ,\sin \left ( n\theta \right ) \}\qquad n=1,2,3,\cdots \tag {5} \end {equation} Now the \(R\) equation is solved

The case for \(\lambda =0\) gives from (2)\begin {align*} r^{2}R^{\prime \prime }+rR^{\prime } & =0\\ R^{\prime \prime }+\frac {1}{r}R^{\prime } & =0\qquad r\neq 0 \end {align*}

The solution to this is\[ R_{0}\left ( r\right ) =A\ln r+C \] Since \(u\) is bounded at \(r=0\) we want \(A=0\). Hence \(R_{0}\left ( r\right ) \) is just a constant.

Case \(\lambda >0\) The ODE (2) becomes\[ r^{2}R^{\prime \prime }+rR^{\prime }-n^{2}R=0\qquad n=1,2,3,\cdots \] Let \(R=r^{p}\), the above becomes\begin {align*} r^{2}p\left ( p-1\right ) r^{p-2}+rpr^{p-1}-n^{2}r^{p} & =0\\ p\left ( p-1\right ) r^{p}+pr^{p}-n^{2}r^{p} & =0\\ p\left ( p-1\right ) +p-n^{2} & =0\\ p^{2} & =n^{2}\\ p & =\pm n \end {align*}

Hence the solution is\[ R_{n}\left ( r\right ) =C_{n}r^{n}+D_{n}\frac {1}{r^{n}}\qquad n=1,2,3,\cdots \] Since \(u\) is bounded at \(r=0\) we want \(D=0\). Hence \(R_{n}\left ( r\right ) =C_{n}r^{n}\).

The complete solution for \(R\left ( r\right ) \) is\begin {equation} R\left ( r\right ) =C_{0}+\sum _{n=1}^{\infty }C_{n}r^{n}\tag {6} \end {equation} Using (5),(6)  gives\begin {align*} u_{n}\left ( r,\theta \right ) & =R_{n}\Theta _{n}\\ u\left ( r,\theta \right ) & =\left ( C_{0}+\sum _{n=1}^{\infty }C_{n}r^{n}\right ) \left ( A_{0}+\sum _{n=1}^{\infty }A_{n}\cos \left ( n\theta \right ) +B_{n}\sin \left ( n\theta \right ) \right ) \end {align*}

Combining constants to simplify things gives\begin {equation} u\left ( r,\theta \right ) =\frac {a_{0}}{2}+\sum _{n=1}^{\infty }r^{n}\left ( A_{n}\cos \left ( n\theta \right ) +B_{n}\sin \left ( n\theta \right ) \right ) \tag {7} \end {equation} When \(r=r_{0}\) the above becomes\[ f\left ( \theta \right ) =\frac {a_{0}}{2}+\sum _{n=1}^{\infty }r_{0}^{n}\left ( A_{n}\cos \left ( n\theta \right ) +B_{n}\sin \left ( n\theta \right ) \right ) \] Hence \begin {align*} a_{0} & =\frac {1}{\pi }\int _{-\pi }^{\pi }f\left ( \theta \right ) d\theta \\ r_{0}^{n}A_{n} & =\frac {1}{\pi }\int _{-\pi }^{\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta \\ A_{n} & =\frac {1}{\pi r_{0}^{n}}\int _{-\pi }^{\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta \end {align*}

And\begin {align*} r_{0}^{n}B_{n} & =\frac {1}{\pi }\int _{-\pi }^{\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta \\ B_{n} & =\frac {1}{\pi r_{0}^{n}}\int _{-\pi }^{\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta \end {align*}

Hence (7) becomes\begin {equation} u\left ( r,\theta \right ) =\frac {1}{2\pi }\int _{-\pi }^{\pi }f\left ( \theta \right ) d\theta +\frac {1}{\pi }\sum _{n=1}^{\infty }\left ( \frac {r}{r_{0}}\right ) ^{n}\left ( \cos \left ( n\theta \right ) \int _{-\pi }^{\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta +\sin \left ( n\theta \right ) \int _{-\pi }^{\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta \right ) \tag {8} \end {equation} In this problem \(f\left ( \theta \right ) =\left ( r_{0}\cos \theta \right ) ^{4}\) where \(r_{0}=4\), hence\begin {align*} A_{0} & =\frac {1}{\pi }\int _{-\pi }^{\pi }256\cos ^{4}\theta d\theta \\ & =\frac {256}{\pi }\int _{-\pi }^{\pi }\cos ^{4}\theta d\theta \\ & =\frac {256}{\pi }\left ( \frac {3\theta }{8}+\frac {1}{4}\sin \left ( 2\theta \right ) +\frac {1}{32}\sin \left ( 4\theta \right ) \right ) _{-\pi }^{\pi }\\ & =\frac {256}{\pi }\left ( \frac {3\pi }{8}+\frac {3\pi }{8}\right ) \\ & =\frac {256}{\pi }\left ( \frac {3\pi }{4}\right ) \\ & =192 \end {align*}

And\begin {align*} A_{n} & =\frac {1}{\pi }\int _{-\pi }^{\pi }256\cos ^{4}\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta \\ & =\frac {256}{\pi }\int _{-\pi }^{\pi }\cos ^{4}\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta \end {align*}

To evaluate the above integral, we will start by using the identity \[ \cos ^{4}\left ( \theta \right ) =\frac {3}{8}+\frac {1}{8}\cos \left ( 4\theta \right ) +\frac {1}{2}\cos \left ( 2\theta \right ) \] Therefore the integral now becomes\begin {align} A_{n} & =\frac {256}{\pi }\int _{-\pi }^{\pi }\left ( \frac {3}{8}+\frac {1}{8}\cos \left ( 4\theta \right ) +\frac {1}{2}\cos \left ( 2\theta \right ) \right ) \cos \left ( n\theta \right ) d\theta \nonumber \\ & =\frac {256}{\pi }\left [ \frac {3}{8}\int _{-\pi }^{\pi }\cos \left ( n\theta \right ) d\theta +\frac {1}{8}\int _{-\pi }^{\pi }\cos \left ( 4\theta \right ) \cos \left ( n\theta \right ) d\theta +\frac {1}{2}\int _{-\pi }^{\pi }\cos \left ( 2\theta \right ) \cos \left ( n\theta \right ) d\theta \right ] \tag {1} \end {align}

But \(\int _{-\pi }^{\pi }\cos \left ( n\theta \right ) d\theta =0\) and \(\int _{-\pi }^{\pi }\cos \left ( 4\theta \right ) \cos \left ( n\theta \right ) d\theta \) is not zero, only for \(n=4\) by orthogonality of cosine functions. Hence \begin {align*} \int _{-\pi }^{\pi }\cos \left ( 4\theta \right ) \cos \left ( n\theta \right ) d\theta & =\int _{-\pi }^{\pi }\cos ^{2}\left ( 4\theta \right ) d\theta \\ & =\pi \end {align*}

And similarly, \(\int _{-\pi }^{\pi }\cos \left ( 2\theta \right ) \cos \left ( n\theta \right ) d\theta \) is not zero, only for \(n=2\) by orthogonality of cosine functions. Hence\begin {align*} \int _{-\pi }^{\pi }\cos \left ( 2\theta \right ) \cos \left ( n\theta \right ) d\theta & =\int _{-\pi }^{\pi }\cos ^{2}\left ( 2\theta \right ) d\theta \\ & =\pi \end {align*}

Using these results in (1) gives, for \(n=2\)\begin {align*} A_{2} & =\frac {256}{\pi }\left [ \frac {1}{2}\int _{-\pi }^{\pi }\cos ^{2}\left ( 2\theta \right ) d\theta \right ] \\ & =\frac {256}{\pi }\left ( \frac {\pi }{2}\right ) \\ & =128 \end {align*}

And for \(n=4\)\begin {align*} A_{4} & =\frac {256}{\pi }\left [ \frac {1}{8}\int _{-\pi }^{\pi }\cos ^{2}\left ( 4\theta \right ) d\theta \right ] \\ & =\frac {256}{\pi }\left ( \frac {\pi }{8}\right ) \\ & =32 \end {align*}

And all other \(A_{n}\) are zero. Now that we found all \(A_{n}\), and since \(B_{n}=0\) for all \(n\) (because \(f\left ( \theta \right ) \) is even function) then the solution (8) becomes\begin {align*} u\left ( r,\theta \right ) & =\frac {192}{2}+a_{2}\left ( \frac {r}{4}\right ) ^{2}\cos \left ( 2\theta \right ) +a_{4}\left ( \frac {r}{4}\right ) ^{4}\cos \left ( 4\theta \right ) \\ & =96+128\left ( \frac {r^{2}}{16}\right ) \cos \left ( 2\theta \right ) +32\frac {r^{4}}{256}\cos \left ( 4\theta \right ) \end {align*}

Therefore\[ u\left ( r,\theta \right ) =96+8r^{2}\cos \left ( 2\theta \right ) +\frac {1}{8}r^{4}\cos \left ( 4\theta \right ) \] Here is plot of the above solution.

____________________________________________________________________________________

4.1.2.3 [307] \(r=1\) and \(u_r=x\) at boundary of disk

problem number 307

Added January 8, 2020.

Problem 4.3.25 part d, Peter J. Olver, Introduction to Partial Differential Equations, 2014 edition.

Solve Laplace equation in polar coordinates inside a disk of radius 1.

Solve \(\nabla ^{2}u=0\) and boundary conditions \(\frac {\partial u}{\partial n}=x\).

Mathematica

ClearAll["Global`*"]; 
pde = Laplacian[u[r, theta], {r, theta}, "Polar"] == 0; 
bc = {Derivative[1, 0][u][1, theta] == Cos[theta], u[r, -Pi] == u[r, Pi], Derivative[0, 1][u][r, -Pi] == Derivative[0, 1][u][r, Pi]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}], 60*10]];
 

Failed

Maple

restart; 
pde:=VectorCalculus:-Laplacian(u(r,theta),'polar'[r,theta])=0; 
bc  := D[1](u)(1, theta) = cos(theta), u(r, -Pi) = u(r, Pi), (D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta))),output='realtime'));
 

sol=()

Hand solution

In polar coordinates, where \(x=r\cos \theta ,y=r\sin \theta \), we need to solve for \(u\left ( r,\theta \right ) \) inside disk of radius \(r_{0}=1\). The Laplace PDE in polar coordinates is\begin {align*} u_{rr}+\frac {1}{r}u_{r}+\frac {1}{r^{2}}u_{\theta \theta } & =0\qquad 0<r<1,-\pi <\theta <\pi \\ u_{r}\left ( 1,\theta \right ) & =f\left ( \theta \right ) =\cos \theta \\ u\left ( -\pi \right ) & =u\left ( \pi \right ) \\ u_{\theta }\left ( -\pi \right ) & =u_{\theta }\left ( \pi \right ) \end {align*}

Using separation of variables, let \(u\left ( r,\theta \right ) =R\left ( r\right ) \Theta \left ( \theta \right ) \) the solution is given by\begin {equation} u\left ( r,\theta \right ) =\frac {a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}r^{n}\cos \left ( n\theta \right ) +b_{n}r^{n}\sin \left ( n\theta \right ) \tag {1} \end {equation} At \(r=r_{0}=1\) we have that \(\frac {\partial u\left ( r,\theta \right ) }{\partial r}=\cos \theta \) (since \(x=r\cos \theta \) but \(r=1\) at boundary). The above becomes\[ \cos \theta =\sum _{n=1}^{\infty }na_{n}r^{n-1}\cos \left ( n\theta \right ) +nb_{n}r^{n-1}\sin \left ( n\theta \right ) \] Therefore \(n=1\) is only term that survives in the sum. Hence \(a_{1}=1\) and all others are zero. The solution (1) becomes\[ u\left ( r,\theta \right ) =\frac {a_{0}}{2}+r\cos \left ( \theta \right ) \] The solution is not unique as there is \(a_{0}\) arbitrary constant.

____________________________________________________________________________________

4.1.2.4 [308] Laplace inside disk. General solution

problem number 308

Solve Laplace equation in polar coordinates inside a disk

Solve for \(u\left ( r,\theta \right ) \) \begin {align*} u_{rr} + \frac {1}{r} u_r + \frac {1}{r^2} u_{\theta \theta }=0 \end {align*}

With \(0 \leq r\leq a, 0 < \theta \leq 2\pi \) Boundary conditions \begin {align*} u(a,\theta ) & = f(\theta ) \\ \left \vert u\left ( 0,\theta \right ) \right \vert & <\infty \\ u\left ( r,0\right ) & =u\left ( r,2\pi \right ) \\ \frac {\partial u}{\partial \theta }\left ( r,0\right ) & =\frac {\partial u}{\partial \theta }\left ( r,2\pi \right ) \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta], {r, 2}] + (1*D[u[r, theta], r])/r + (1*D[u[r, theta], {theta, 2}])/r^2 == 0; 
bc  = u[a, theta] == f[theta]; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> a < r && a > 0 && Inequality[0, Less, theta, LessEqual, 2*Pi]], 60*10]]; 
sol =  sol /. K[1] -> n;
 

\[\left \{\left \{u(r,\theta )\to \underset {n=1}{\overset {\infty }{\sum }}\frac {\left (\frac {r}{a}\right )^n \left (\cos (n \theta ) \int _{-\pi }^{\pi } \cos (n \theta ) f(\theta ) \, d\theta +\left (\int _{-\pi }^{\pi } f(\theta ) \sin (n \theta ) \, d\theta \right ) \sin (n \theta )\right )}{\pi }+\frac {\int _{-\pi }^{\pi } f(\theta ) \, d\theta }{2 \pi }\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := (diff(r*(diff(u(r, theta), r)), r))/r +(diff(u(r, theta), theta, theta))/r^2 = 0; 
bc  := u(a, theta) = f(theta), 
      u(r, -Pi) = u(r, Pi), 
      (D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta), HINT = boundedseries(r=0))),output='realtime'));
 

\[u \left ( r,\theta \right ) =1/2\,{\frac {1}{\pi } \left ( 2\,\sum _{n=1}^{\infty } \left ( {\frac {\sin \left ( n\theta \right ) \int _{-\pi }^{\pi }\!f \left ( \theta \right ) \sin \left ( n\theta \right ) \,{\rm d}\theta +\cos \left ( n\theta \right ) \int _{-\pi }^{\pi }\!f \left ( \theta \right ) \cos \left ( n\theta \right ) \,{\rm d}\theta }{\pi } \left ( {\frac {a}{r}} \right ) ^{-n}} \right ) \pi +\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \,{\rm d}\theta \right ) }\]

____________________________________________________________________________________

4.1.2.5 [309] Laplace inside disk. Specific boundary conditions

problem number 309

Added January 12, 2020

Solve \(u_{xx}+u_{yy}=0\) on disk \(x^{2}+y^{2}<1\) with boundary condition \(xy^{2}\) when \(x^{2}+y^{2}=a\). Where \(a=1\) in this problem. Express solution in \(x,y\)

The first step is to convert the boundary condition to polar coordinates. Since \(x=r\cos \theta ,y=r\sin \theta \), then at the boundary \(u\left ( r,\theta \right ) =r\cos \theta \left ( r\sin \theta \right ) ^{2}\). But \(r=1\) (the radius). Hence at the boundary, \(u\left ( 1,\theta \right ) =f\left ( \theta \right ) \) where \begin {align*} f\left ( \theta \right ) & =\cos \theta \sin ^{2}\theta \\ & =\cos \theta \left ( 1-\cos ^{2}\theta \right ) \\ & =\cos \theta -\cos ^{3}\theta \end {align*}

But \(\cos ^{3}\theta =\frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \). Therefore the above becomes\begin {align} f\left ( \theta \right ) & =\cos \theta -\left ( \frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \right ) \nonumber \\ & =\frac {1}{4}\cos \theta -\frac {1}{4}\cos 3\theta \tag {1} \end {align}

The above is also seen as the Fourier series of \(f\left ( \theta \right ) \). The PDE in polar coordinates is\[ u_{rr}+\frac {1}{r}u_{r}+\frac {1}{r^{2}}u_{\theta \theta }=0 \]

Mathematica

ClearAll["Global`*"]; 
a = 1; 
pde = Laplacian[u[r, theta], {r, theta}, "Polar"] == 0; 
f[theta_] := 1/4*(Cos[theta] - Cos[3*theta]); 
bc = {u[a, theta] == f[theta], u[r, -Pi] == u[r, Pi], Derivative[0, 1][u][r, -Pi] == Derivative[0, 1][u][r, Pi]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \frac {1}{4} \left (r \cos (\theta )-r^3 \cos (3 \theta )\right )\right \}\right \}\]

Maple

restart; 
f:=theta-> 1/4*(cos(theta) - cos(3*theta)); 
a:=1; 
pde := VectorCalculus:-Laplacian(u(r,theta),'polar'[r,theta]); 
bc := u(a, theta) = f(theta),u(r, -Pi) = u(r, Pi),(D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta), HINT = boundedseries(r=0))),output='realtime')); 
sol:=simplify(subs(cos(theta)^3=trigsubs(cos(theta)^3)[2],sol),size);
 

\[u \left ( r,\theta \right ) =1/4\,r \left ( -{r}^{2}\cos \left ( 3\,\theta \right ) +\cos \left ( \theta \right ) \right ) \]

Hand solution

Solve \(u_{xx}+u_{yy}=0\) on disk \(x^{2}+y^{2}<1\) with boundary condition \(xy^{2}\) when \(x^{2}+y^{2}=a\). Where \(a=1\) in this problem. Express solution in \(x,y\)

The first step is to convert the boundary condition to polar coordinates. Since \(x=r\cos \theta ,y=r\sin \theta \), then at the boundary \(u\left ( r,\theta \right ) =r\cos \theta \left ( r\sin \theta \right ) ^{2}\). But \(r=1\) (the radius). Hence at the boundary, \(u\left ( 1,\theta \right ) =f\left ( \theta \right ) \) where \begin {align*} f\left ( \theta \right ) & =\cos \theta \sin ^{2}\theta \\ & =\cos \theta \left ( 1-\cos ^{2}\theta \right ) \\ & =\cos \theta -\cos ^{3}\theta \end {align*}

But \(\cos ^{3}\theta =\frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \). Therefore the above becomes\begin {align} f\left ( \theta \right ) & =\cos \theta -\left ( \frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \right ) \nonumber \\ & =\frac {1}{4}\cos \theta -\frac {1}{4}\cos 3\theta \tag {1} \end {align}

The above is also seen as the Fourier series of \(f\left ( \theta \right ) \). The PDE in polar coordinates is\[ u_{rr}+\frac {1}{r}u_{r}+\frac {1}{r^{2}}u_{\theta \theta }=0 \] The solution is known to be\begin {equation} u\left ( r,\theta \right ) =\frac {c_{0}}{2}+\sum _{n=1}^{\infty }r^{n}\left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \tag {2} \end {equation} Since the above solution is the same as \(f\left ( \theta \right ) \) when \(r=1\), then equating (2) when \(r=1\) to (1) gives\[ \frac {1}{4}\cos \theta -\frac {1}{4}\cos 3\theta =\frac {c_{0}}{2}+\sum _{n=1}^{\infty }\left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \] By comparing terms on both sides, this shows by inspection that\begin {align*} c_{0} & =0\\ c_{1} & =\frac {1}{4}\\ c_{3} & =\frac {-1}{4} \end {align*}

And all other \(c_{n},k_{n}\) are zero. Using the above result back in (2) gives the solution as\begin {equation} \fbox {$u\left ( r,\theta \right ) =\frac {r}{4}\cos \theta -\frac {r^3}{4}\cos 3\theta $}\tag {3} \end {equation} This solution is now converted to \(xy\) using the formula\begin {align*} r^{n}\cos n\theta & =\sum _{\substack {k=0\\even}}^{n}\begin {pmatrix} n\\ k \end {pmatrix} x^{n-k}\left ( -1\right ) ^{\frac {k}{2}}y^{k}\\ & =\sum _{\substack {k=0\\even}}^{n}\frac {n!}{k!\left ( n-k\right ) !}x^{n-k}\left ( -1\right ) ^{\frac {k}{2}}y^{k} \end {align*}

For \(n=1\) the above gives\begin {align} r\cos \theta & =\frac {1!}{0!\left ( 1-0\right ) !}x^{1-0}\left ( -1\right ) ^{0}y^{0}\nonumber \\ & =x\tag {4} \end {align}

And for \(n=3\)\begin {align} r^{3}\cos 3\theta & =\frac {3!}{0!\left ( 3-0\right ) !}x^{3-0}\left ( -1\right ) ^{0}y^{0}+\frac {3!}{2!\left ( 3-2\right ) !}x^{3-2}\left ( -1\right ) ^{1}y^{2}\nonumber \\ & =x^{3}-3xy^{2}\tag {5} \end {align}

Using (4,5) in (3) gives the solution in \(x,y\)\begin {equation} \fbox {$u\left ( x,y\right ) =\frac {1}{4}x-\frac {1}{4}\left ( x^3-3xy^2\right ) $}\tag {6} \end {equation} This is now verified that is satisfies the PDE \(u_{xx}+u_{yy}=0\).\begin {align*} \frac {\partial u}{\partial x} & =\frac {1}{4}-\frac {1}{4}\left ( 3x^{2}-3y^{2}\right ) \\ \frac {\partial ^{2}u}{\partial x^{2}} & =-\frac {6}{4}x \end {align*}

And\begin {align*} \frac {\partial u}{\partial y} & =\frac {6}{4}xy\\ \frac {\partial ^{2}u}{\partial y^{2}} & =\frac {6}{4}x \end {align*}

Therefore \(\frac {\partial ^{2}u}{\partial x^{2}}+\frac {\partial ^{2}u}{\partial y^{2}}=0\).

Now the boundary conditions \(u\left ( x,y\right ) =xy^{2}\) are also verified. This condition applies when \(x^{2}+y^{2}=1\) or \(y^{2}=1-x^{2}\). Substituting this into (6) gives\[ u\left ( x,y\right ) _{@D}=\frac {1}{4}x-\frac {1}{4}\left ( x^{3}-3x\overset {y2}{\overbrace {\left ( 1-x^{2}\right ) }}\right ) \] Simplifying gives\begin {align*} u\left ( x,y\right ) _{@D} & =\frac {1}{4}x-\frac {1}{4}\left ( x^{3}-\left ( 3x-3x^{3}\right ) \right ) \\ & =\frac {1}{4}x-\frac {1}{4}x^{3}+\frac {1}{4}\left ( 3x-3x^{3}\right ) \\ & =\frac {1}{4}x-\frac {1}{4}x^{3}+\frac {3}{4}x-\frac {3}{4}x^{3}\\ & =x-x^{3}\\ & =x\left ( 1-x^{2}\right ) \\ & =xy^{2} \end {align*}

Verified. This is 3D plot of the solution

pict

This is a contour plot

pict

____________________________________________________________________________________

4.1.2.6 [310] Haberman 2.5.5 (c)

problem number 310

This is problem 2.5.5 part (c) from Richard Haberman applied partial differential equations, 5th edition

Solve Laplace equation \[ u_{rr} + \frac {1}{r} u_r + \frac {1}{r^2} u_{\theta \theta } = 0 \] Inside quarter circle of radius 1 with \(0 \leq \theta \leq \frac {\pi }{2}\) and \(0 \leq r \leq 1\), with following boundary conditions \begin {align*} u(r,0) &= 0 \\ u(r,\frac {\pi }{2}) &= 0 \\ \frac {\partial u}{\partial r}(1,\theta ) &= f(\theta ) \\ \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta], {r, 2}] + (1*D[u[r, theta], r]*1*D[u[r, theta], {theta, 2}])/(r*r^2) == 0; 
bc  = {Derivative[1, 0][u][1, theta] == f[theta], u[r, Pi/2] == 0, u[r, 0] == 0}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> {0 <= r <= 1 && 0 <= theta <= Pi/2}], 60*10]];
 

Failed

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(r,theta),r$2)+ 1/r*diff(u(r,theta),r)+1/r^2*diff(u(r,theta),theta$2)=0; 
bc  := u(r,0)=0,u(r,Pi/2)=0,D[1](u)(1,theta)=f(theta); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(r,theta),HINT=boundedseries(r=0)) assuming 0<=theta,theta<=Pi/2,0<=r,r<=1),output='realtime'));
 

\[u \left ( r,\theta \right ) =\sum _{n=1}^{\infty } \left ( 2\,{\frac {\int _{0}^{\pi /2}\!f \left ( \theta \right ) \sin \left ( 2\,n\theta \right ) \,{\rm d}\theta {r}^{2\,n}\sin \left ( 2\,n\theta \right ) }{\pi \,n}} \right ) \]

Hand solution

The Laplace PDE in polar coordinates is  \begin {equation} r^{2}\frac {\partial ^{2}u}{\partial r^{2}}+r\frac {\partial u}{\partial r}+\frac {\partial ^{2}u}{\partial \theta ^{2}}=0\tag {A} \end {equation} With boundary conditions \begin {align} u\left ( r,0\right ) & =0\nonumber \\ u\left ( r,\frac {\pi }{2}\right ) & =0\tag {B}\\ u\left ( 1,\theta \right ) & =f\left ( \theta \right ) \nonumber \end {align}

Assuming the solution can be written as \[ u\left ( r,\theta \right ) =R\left ( r\right ) \Theta \left ( \theta \right ) \] And substituting this assumed solution back into the (A) gives\[ r^{2}R^{\prime \prime }\Theta +rR^{\prime }\Theta +R\Theta ^{\prime \prime }=0 \] Dividing the above by \(R\Theta \neq 0\) gives\begin {align*} r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R}+\frac {\Theta ^{\prime \prime }}{\Theta } & =0\\ r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R} & =-\frac {\Theta ^{\prime \prime }}{\Theta } \end {align*}

Since each side depends on different independent variable and they are equal, they must be equal to same constant. say \(\lambda \). \[ r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R}=-\frac {\Theta ^{\prime \prime }}{\Theta }=\lambda \] This results in the following two ODE’s. The boundaries conditions in (B) are also transferred to each ODE. This gives\begin {align} \Theta ^{\prime \prime }+\lambda \Theta & =0\nonumber \\ \Theta \left ( 0\right ) & =0\tag {1}\\ \Theta \left ( \frac {\pi }{2}\right ) & =0\nonumber \end {align}

And\begin {align} r^{2}R^{\prime \prime }+rR^{\prime }-\lambda R & =0\tag {2}\\ \left \vert R\left ( 0\right ) \right \vert & <\infty \nonumber \end {align}

Starting with (1). Consider the Case \(\lambda <0\). The solution in this case will be \[ \Theta =A\cosh \left ( \sqrt {\lambda }\theta \right ) +B\sinh \left ( \sqrt {\lambda }\theta \right ) \] Applying first B.C. gives \(A=0\). The solution becomes \(\Theta =B\sinh \left ( \sqrt {\lambda }\theta \right ) \). Applying second B.C. gives \[ 0=B\sinh \left ( \sqrt {\lambda }\frac {\pi }{2}\right ) \] But \(\sinh \) is zero only when \(\sqrt {\lambda }\frac {\pi }{2}=0\) which is not the case here. Therefore \(B=0\) and hence trivial solution. Hence \(\lambda <0\) is not an eigenvalue.

Case \(\lambda =0\) The ODE becomes \(\Theta ^{\prime \prime }=0\) with solution \(\Theta =A\theta +B\). First B.C. gives \(0=B\). The solution becomes \(\Theta =A\theta \). Second B.C. gives \(0=A\frac {\pi }{2}\), hence \(A=0\) and trivial solution. Therefore \(\lambda =0\) is not an eigenvalue.

Case \(\lambda >0\) The ODE becomes \(\Theta ^{\prime \prime }+\lambda \Theta =0\) with solution \[ \Theta =A\cos \left ( \sqrt {\lambda }\theta \right ) +B\sin \left ( \sqrt {\lambda }\theta \right ) \] The first B.C. gives \(0=A\). The solution becomes \[ \Theta =B\sin \left ( \sqrt {\lambda }\theta \right ) \] And the second B.C. gives \[ 0=B\sin \left ( \sqrt {\lambda }\frac {\pi }{2}\right ) \] For non-trivial solution \(\sin \left ( \sqrt {\lambda }\frac {\pi }{2}\right ) =0\) or \(\sqrt {\lambda }\frac {\pi }{2}=n\pi \) for \(n=1,2,3,\cdots \). Hence the eigenvalues are\begin {align*} \sqrt {\lambda _{n}} & =2n\\ \lambda _{n} & =4n^{2}\qquad n=1,2,3,\cdots \end {align*}

And the eigenfunctions are \begin {equation} \Theta _{n}\left ( \theta \right ) =B_{n}\sin \left ( 2n\theta \right ) \qquad n=1,2,3,\cdots \tag {3} \end {equation} Now the \(R\) ODE is solved. There is one case to consider, which is \(\lambda >0\) based on the above. The ODE is\begin {align*} r^{2}R^{\prime \prime }+rR^{\prime }-\lambda _{n}R & =0\\ r^{2}R^{\prime \prime }+rR^{\prime }-4n^{2}R & =0\qquad n=1,2,3,\cdots \end {align*}

This is Euler ODE. Let \(R\left ( r\right ) =r^{p}\). Then \(R^{\prime }=pr^{p-1}\) and \(R^{\prime \prime }=p\left ( p-1\right ) r^{p-2}\). This gives\begin {align*} r^{2}\left ( p\left ( p-1\right ) r^{p-2}\right ) +r\left ( pr^{p-1}\right ) -4n^{2}r^{p} & =0\\ \left ( \left ( p^{2}-p\right ) r^{p}\right ) +pr^{p}-4n^{2}r^{p} & =0\\ r^{p}p^{2}-pr^{p}+pr^{p}-4n^{2}r^{p} & =0\\ p^{2}-4n^{2} & =0\\ p & =\pm 2n \end {align*}

Hence the solution is\[ R\left ( r\right ) =Cr^{2n}+D\frac {1}{r^{2n}}\] Applying the condition that \(\left \vert R\left ( 0\right ) \right \vert <\infty \) implies \(D=0\), and the solution becomes\begin {equation} R_{n}\left ( r\right ) =C_{n}r^{2n}\qquad n=1,2,3,\cdots \tag {4} \end {equation} Using (3,4) the solution \(u_{n}\left ( r,\theta \right ) \) is\begin {align*} u_{n}\left ( r,\theta \right ) & =R_{n}\Theta _{n}\\ & =C_{n}r^{2n}B_{n}\sin \left ( 2n\theta \right ) \\ & =B_{n}r^{2n}\sin \left ( 2n\theta \right ) \end {align*}

Where \(C_{n}B_{n}\) was combined into one constant \(B_{n}\). (No need to introduce new symbol). The final solution is\begin {align*} u\left ( r,\theta \right ) & =\sum _{n=1}^{\infty }u_{n}\left ( r,\theta \right ) \\ & =\sum _{n=1}^{\infty }B_{n}r^{2n}\sin \left ( 2n\theta \right ) \end {align*}

Now the nonhomogeneous condition is applied to find \(B_{n}\).\[ \frac {\partial }{\partial r}u\left ( r,\theta \right ) =\sum _{n=1}^{\infty }B_{n}\left ( 2n\right ) r^{2n-1}\sin \left ( 2n\theta \right ) \] Hence \(\frac {\partial }{\partial r}u\left ( 1,\theta \right ) =f\left ( \theta \right ) \) becomes\[ f\left ( \theta \right ) =\sum _{n=1}^{\infty }2B_{n}n\sin \left ( 2n\theta \right ) \] Multiplying by \(\sin \left ( 2m\theta \right ) \) and integrating gives\begin {align} \int _{0}^{\frac {\pi }{2}}f\left ( \theta \right ) \sin \left ( 2m\theta \right ) d\theta & =\int _{0}^{\frac {\pi }{2}}\sin \left ( 2m\theta \right ) \sum _{n=1}^{\infty }2B_{n}n\sin \left ( 2n\theta \right ) d\theta \nonumber \\ & =\sum _{n=1}^{\infty }2nB_{n}\int _{0}^{\frac {\pi }{2}}\sin \left ( 2m\theta \right ) \sin \left ( 2n\theta \right ) d\theta \tag {5} \end {align}

When \(n=m\) then\begin {align*} \int _{0}^{\frac {\pi }{2}}\sin \left ( 2m\theta \right ) \sin \left ( 2n\theta \right ) d\theta & =\int _{0}^{\frac {\pi }{2}}\sin ^{2}\left ( 2n\theta \right ) d\theta \\ & =\int _{0}^{\frac {\pi }{2}}\left ( \frac {1}{2}-\frac {1}{2}\cos 4n\theta \right ) d\theta \\ & =\frac {1}{2}\left [ \theta \right ] _{0}^{\frac {\pi }{2}}-\frac {1}{2}\left [ \frac {\sin 4n\theta }{4n}\right ] _{0}^{\frac {\pi }{2}}\\ & =\frac {\pi }{4}-\left ( \frac {1}{8n}\left ( \sin \frac {4n}{2}\pi \right ) -\sin \left ( 0\right ) \right ) \end {align*}

And since \(n\) is integer, then \(\sin \frac {4n}{2}\pi =\sin 2n\pi =0\) and the above becomes \(\frac {\pi }{4}\).

Now for the case when \(n\neq m\) using \(\sin A\sin B=\frac {1}{2}\left ( \cos \left ( A-B\right ) -\cos \left ( A+B\right ) \right ) \) then\begin {align*} \int _{0}^{\frac {\pi }{2}}\sin \left ( 2m\theta \right ) \sin \left ( 2n\theta \right ) d\theta & =\int _{0}^{\frac {\pi }{2}}\frac {1}{2}\left ( \cos \left ( 2m\theta -2n\theta \right ) -\cos \left ( 2m\theta +2n\theta \right ) \right ) d\theta \\ & =\frac {1}{2}\int _{0}^{\frac {\pi }{2}}\cos \left ( 2m\theta -2n\theta \right ) d\theta -\frac {1}{2}\int _{0}^{\frac {\pi }{2}}\cos \left ( 2m\theta +2n\theta \right ) d\theta \\ & =\frac {1}{2}\int _{0}^{\frac {\pi }{2}}\cos \left ( \left ( 2m-2n\right ) \theta \right ) d\theta -\frac {1}{2}\int _{0}^{\frac {\pi }{2}}\cos \left ( \left ( 2m+2n\right ) \theta \right ) d\theta \\ & =\frac {1}{2}\left [ \frac {\sin \left ( \left ( 2m-2n\right ) \theta \right ) }{\left ( 2m-2n\right ) }\right ] _{0}^{\frac {\pi }{2}}-\frac {1}{2}\left [ \frac {\sin \left ( \left ( 2m+2n\right ) \theta \right ) }{\left ( 2m+2n\right ) }\right ] _{0}^{\frac {\pi }{2}}\\ & =\frac {1}{4\left ( m-n\right ) }\left [ \sin \left ( \left ( 2m-2n\right ) \theta \right ) \right ] _{0}^{\frac {\pi }{2}}-\frac {1}{4\left ( m+n\right ) }\left [ \sin \left ( \left ( 2m+2n\right ) \theta \right ) \right ] _{0}^{\frac {\pi }{2}}\\ & =\frac {1}{4\left ( m-n\right ) }\left [ \sin \left ( \left ( 2m-2n\right ) \frac {\pi }{2}\right ) -0\right ] -\frac {1}{4\left ( m+n\right ) }\left [ \sin \left ( \left ( 2m+2n\right ) \frac {\pi }{2}\right ) -0\right ] \end {align*}

Since \(2m-2n\frac {\pi }{2}=\pi \left ( m-n\right ) \) which is integer multiple of \(\pi \) and also \(\left ( 2m+2n\right ) \frac {\pi }{2}\) is integer multiple of \(\pi \) then the whole term above becomes zero. Therefore (5) becomes\[ \int _{0}^{\frac {\pi }{2}}f\left ( \theta \right ) \sin \left ( 2m\theta \right ) d\theta =2mB_{m}\frac {\pi }{4}\] Hence\[ B_{n}=\frac {2}{\pi n}\int _{0}^{\frac {\pi }{2}}f\left ( \theta \right ) \sin \left ( 2n\theta \right ) d\theta \] Summary: the final solution is\[ u\left ( r,\theta \right ) =\frac {2}{\pi }\sum _{n=1}^{\infty }\frac {1}{n}\left [ \int _{0}^{\frac {\pi }{2}}f\left ( \theta \right ) \sin \left ( 2n\theta \right ) d\theta \right ] \left ( r^{2n}\sin \left ( 2n\theta \right ) \right ) \]

____________________________________________________________________________________

4.1.2.7 [311] semi-circle

problem number 311

Solve Laplace equation \[ u_{rr} + \frac {1}{r }u_r + \frac {1}{r^2} u_{\theta \theta } = 0 \] Inside semi-circle of radius 1 with \(0 \leq \theta \leq \pi \) and \(0 \leq r \leq 1\), with following boundary conditions \begin {align*} u(r,0) &= 0 \\ u(r,\pi ) &= 0 \\ u(1,\theta ) &= f(\theta ) \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde = D[u[r, theta], {r, 2}] + (1/r) D[u[r, theta], r] + 1/r^2*D[u[r, theta], {theta, 2}] == 0; 
bc  = {u[r, 0] == 0, u[r, Pi] == 0, u[1, theta] == f[theta]}; 
sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> {0 < r <= 1 && 0 < theta < Pi}], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \underset {K[1]=1}{\overset {\infty }{\sum }}\sqrt {\frac {2}{\pi }} r^{K[1]} \left (\int _0^{\pi } \sqrt {\frac {2}{\pi }} f(\theta ) \sin (\theta K[1]) \, d\theta \right ) \sin (\theta K[1])\right \}\right \}\]

Maple

restart; 
pde := diff(u(r,theta),r$2)+1/r*diff(u(r,theta),r)+1/r^2*diff(u(r,theta),theta$2)=0; 
bc  := u(r,0)=0,u(r,Pi)=0,u(1,theta)=f(theta); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(r,theta),HINT=boundedseries) assuming 0<r,r<1,0<theta,theta<Pi),output='realtime'));
 

\[u \left ( r,\theta \right ) =\sum _{n=1}^{\infty } \left ( 2\,{\frac {\int _{0}^{\pi }\!f \left ( \theta \right ) \sin \left ( n\theta \right ) \,{\rm d}\theta {r}^{n}\sin \left ( n\theta \right ) }{\pi }} \right ) \]

____________________________________________________________________________________

4.1.2.8 [312] Haberman 2.5.8 (b)

problem number 312

This is problem 2.5.8 part (b) from Richard Haberman applied partial differential equations, 5th edition

Solve Laplace equation \(\nabla ^2 u(r,\theta )=0\) or \[ u_{rr} + \frac {1}{r } u_r +\frac {1}{r^2} u_{\theta \theta } =0 \] Inside circular annulus \(a<r<b\) subject to the following boundary conditions \begin {align*} \frac {\partial u}{\partial r}(a,\theta ) &= 0 \\ u(b,\theta ) &= g(\theta ) \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde = D[u[r, theta], {r, 2}] + 1/r*D[u[r, theta], r] + 1/r^2*D[u[r, theta], {theta, 2}] == 0; 
bc  = {Derivative[1, 0][u][a, theta] == 0, u[b, theta] == g[theta]}; 
sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> a < r < b], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {\int _0^{2 \pi } g(K[2]) \, dK[2]}{2 \pi }+\underset {K[1]=1}{\overset {\infty }{\sum }}\left (\cos (\theta K[1]) \left (\frac {a^{2 K[1]} b^{K[1]} \left (\int _0^{2 \pi } \frac {\cos (K[1] K[2]) g(K[2])}{\pi } \, dK[2]\right ) r^{-K[1]}}{a^{2 K[1]}+b^{2 K[1]}}+\frac {b^{K[1]} \left (\int _0^{2 \pi } \frac {\cos (K[1] K[2]) g(K[2])}{\pi } \, dK[2]\right ) r^{K[1]}}{a^{2 K[1]}+b^{2 K[1]}}\right )+\left (\frac {a^{2 K[1]} b^{K[1]} \left (\int _0^{2 \pi } \frac {g(K[2]) \sin (K[1] K[2])}{\pi } \, dK[2]\right ) r^{-K[1]}}{a^{2 K[1]}+b^{2 K[1]}}+\frac {b^{K[1]} \left (\int _0^{2 \pi } \frac {g(K[2]) \sin (K[1] K[2])}{\pi } \, dK[2]\right ) r^{K[1]}}{a^{2 K[1]}+b^{2 K[1]}}\right ) \sin (\theta K[1])\right ) & a\leq r\leq b \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(r,theta),r$2)+1/r*diff(u(r,theta),r)+1/r^2*diff(u(r,theta),theta$2)=0; 
bc:=D[1](u)(a,theta)=0,u(b,theta)=g(theta); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(r,theta)) assuming a<r,r<b),output='realtime'));
 

\[u \left ( r,\theta \right ) =-{\it invfourier} \left ( {\frac {{\it fourier} \left ( g \left ( \theta \right ) ,\theta ,s \right ) {{\rm e}^{2\, \left ( \ln \left ( a \right ) -\ln \left ( b \right ) \right ) s}}}{{{\rm e}^{2\, \left ( \ln \left ( a \right ) -\ln \left ( b \right ) \right ) s}}+1}},s,\theta \right ) -{\it invfourier} \left ( {\frac {{\it fourier} \left ( g \left ( \theta \right ) ,\theta ,s \right ) }{{{\rm e}^{2\, \left ( \ln \left ( a \right ) -\ln \left ( b \right ) \right ) s}}+1}},s,\theta \right ) +{\it invfourier} \left ( {\frac {{\it fourier} \left ( g \left ( \theta \right ) ,\theta ,s \right ) {r}^{s}{a}^{-s}{{\rm e}^{ \left ( \ln \left ( a \right ) -\ln \left ( b \right ) \right ) s}}}{{{\rm e}^{2\, \left ( \ln \left ( a \right ) -\ln \left ( b \right ) \right ) s}}+1}},s,\theta \right ) +{\it invfourier} \left ( {\frac {{\it fourier} \left ( g \left ( \theta \right ) ,\theta ,s \right ) {{\rm e}^{s \left ( 2\,\ln \left ( a \right ) -\ln \left ( b \right ) -\ln \left ( r \right ) \right ) }}}{{{\rm e}^{2\, \left ( \ln \left ( a \right ) -\ln \left ( b \right ) \right ) s}}+1}},s,\theta \right ) +g \left ( \theta \right ) \] But has unresolved Invfourier and Fourier calls

Hand solution

The Laplace PDE in polar coordinates is  \begin {equation} r^{2}\frac {\partial ^{2}u}{\partial r^{2}}+r\frac {\partial u}{\partial r}+\frac {\partial ^{2}u}{\partial \theta ^{2}}=0\tag {A} \end {equation} With\begin {align} \frac {\partial u}{\partial r}\left ( a,\theta \right ) & =0\nonumber \\ u\left ( b,\theta \right ) & =g\left ( \theta \right ) \tag {B} \end {align}

Assuming the solution can be written as \[ u\left ( r,\theta \right ) =R\left ( r\right ) \Theta \left ( \theta \right ) \] And substituting this assumed solution back into the (A) gives\[ r^{2}R^{\prime \prime }\Theta +rR^{\prime }\Theta +R\Theta ^{\prime \prime }=0 \] Dividing the above by \(R\Theta \) gives\begin {align*} r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R}+\frac {\Theta ^{\prime \prime }}{\Theta } & =0\\ r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R} & =-\frac {\Theta ^{\prime \prime }}{\Theta } \end {align*}

Since each side depends on different independent variable and they are equal, they must be equal to same constant. say \(\lambda \). \[ r^{2}\frac {R^{\prime \prime }}{R}+r\frac {R^{\prime }}{R}=-\frac {\Theta ^{\prime \prime }}{\Theta }=\lambda \] This results in the following two ODE’s. The boundaries conditions in (B) are also transferred to each ODE. This results in\begin {align} \Theta ^{\prime \prime }+\lambda \Theta & =0\tag {1}\\ \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \nonumber \\ \Theta ^{\prime }\left ( -\pi \right ) & =\Theta ^{\prime }\left ( \pi \right ) \nonumber \end {align}

And\begin {align} r^{2}R^{\prime \prime }+rR^{\prime }-\lambda R & =0\tag {2}\\ R^{\prime }\left ( a\right ) & =0\nonumber \end {align}

Starting with (1)

Case \(\lambda <0\) The solution is\[ \Theta \left ( \theta \right ) =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) \] First B.C. gives\begin {align*} \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \\ A\cosh \left ( -\sqrt {\left \vert \lambda \right \vert }\pi \right ) +B\sinh \left ( -\sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) -B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ 2B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =0 \end {align*}

But \(\sinh =0\) only at zero and \(\lambda \neq 0\), hence \(B=0\) and the solution becomes\begin {align*} \Theta \left ( \theta \right ) & =A\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) \\ \Theta ^{\prime }\left ( \theta \right ) & =A\sqrt {\lambda }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\theta \right ) \end {align*}

Applying the second B.C. gives\begin {align*} \Theta ^{\prime }\left ( -\pi \right ) & =\Theta ^{\prime }\left ( \pi \right ) \\ A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( -\sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) \\ 2A\sqrt {\left \vert \lambda \right \vert }\cosh \left ( \sqrt {\left \vert \lambda \right \vert }\pi \right ) & =0 \end {align*}

But \(\cosh \) is never zero, hence \(A=0\). Therefore trivial solution and \(\lambda <0\) is not an eigenvalue.

Case \(\lambda =0\) The solution is \(\Theta =A\theta +B\). Applying the first B.C. gives\begin {align*} \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \\ -A\pi +B & =\pi A+B\\ 2\pi A & =0\\ A & =0 \end {align*}

And the solution becomes \(\Theta =B_{0}\). A constant. Hence \(\lambda =0\) is an eigenvalue.

Case \(\lambda >0\)

The solution becomes\begin {align*} \Theta & =A\cos \left ( \sqrt {\lambda }\theta \right ) +B\sin \left ( \sqrt {\lambda }\theta \right ) \\ \Theta ^{\prime } & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\theta \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\theta \right ) \end {align*}

Applying first B.C. gives\begin {align} \Theta \left ( -\pi \right ) & =\Theta \left ( \pi \right ) \nonumber \\ A\cos \left ( -\sqrt {\lambda }\pi \right ) +B\sin \left ( -\sqrt {\lambda }\pi \right ) & =A\cos \left ( \sqrt {\lambda }\pi \right ) +B\sin \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ A\cos \left ( \sqrt {\lambda }\pi \right ) -B\sin \left ( \sqrt {\lambda }\pi \right ) & =A\cos \left ( \sqrt {\lambda }\pi \right ) +B\sin \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ 2B\sin \left ( \sqrt {\lambda }\pi \right ) & =0 \tag {3} \end {align}

Applying second B.C. gives\begin {align} \Theta ^{\prime }\left ( -\pi \right ) & =\Theta ^{\prime }\left ( \pi \right ) \nonumber \\ -A\sqrt {\lambda }\sin \left ( -\sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( -\sqrt {\lambda }\pi \right ) & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\pi \right ) & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) +B\sqrt {\lambda }\cos \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) & =-A\sqrt {\lambda }\sin \left ( \sqrt {\lambda }\pi \right ) \nonumber \\ 2A\sin \left ( \sqrt {\lambda }\pi \right ) & =0 \tag {4} \end {align}

Equations (3,4) can be both zero only if \(A=B=0\) which gives trivial solution, or when \(\sin \left ( \sqrt {\lambda }\pi \right ) =0\). Therefore taking \(\sin \left ( \sqrt {\lambda }\pi \right ) =0\) gives a non-trivial solution. Hence\begin {align*} \sqrt {\lambda }\pi & =n\pi \qquad n=1,2,3,\cdots \\ \lambda _{n} & =n^{2}\qquad n=1,2,3,\cdots \end {align*}

Hence the solution for \(\Theta \) is\begin {equation} \Theta =A_{0}+\sum _{n=1}^{\infty }A_{n}\cos \left ( n\theta \right ) +B_{n}\sin \left ( n\theta \right ) \tag {5} \end {equation} Now the \(R\) equation is solved

The case for \(\lambda =0\) gives\begin {align*} r^{2}R^{\prime \prime }+rR^{\prime } & =0\\ R^{\prime \prime }+\frac {1}{r}R^{\prime } & =0\qquad r\neq 0 \end {align*}

As was done in last problem, the solution to this is\[ R\left ( r\right ) =A\ln \left \vert r\right \vert +C \] Since \(r>0\) no need to keep worrying about \(\left \vert r\right \vert \) and is removed for simplicity. Applying the B.C. gives\[ R^{\prime }=A\frac {1}{r}\] Evaluating at \(r=a\) gives\[ 0=A\frac {1}{a}\] Hence \(A=0\), and the solution becomes\[ R\left ( r\right ) =C_{0}\] Which is a constant.

Case \(\lambda >0\) The ODE in this case is \[ r^{2}R^{\prime \prime }+rR^{\prime }-n^{2}R=0\qquad n=1,2,3,\cdots \] Let \(R=r^{p}\), the above becomes\begin {align*} r^{2}p\left ( p-1\right ) r^{p-2}+rpr^{p-1}-n^{2}r^{p} & =0\\ p\left ( p-1\right ) r^{p}+pr^{p}-n^{2}r^{p} & =0\\ p\left ( p-1\right ) +p-n^{2} & =0\\ p^{2} & =n^{2}\\ p & =\pm n \end {align*}

Hence the solution is\[ R_{n}\left ( r\right ) =Cr^{n}+D\frac {1}{r^{n}}\qquad n=1,2,3,\cdots \] Applying the boundary condition \(R^{\prime }\left ( a\right ) =0\) gives\begin {align*} R_{n}^{\prime }\left ( r\right ) & =nC_{n}r^{n-1}-nD_{n}\frac {1}{r^{n+1}}\\ 0 & =R_{n}^{\prime }\left ( a\right ) \\ & =nC_{n}a^{n-1}-nD_{n}\frac {1}{a^{n+1}}\\ & =nC_{n}a^{2n}-nD_{n}\\ & =C_{n}a^{2n}-D_{n}\\ D_{n} & =C_{n}a^{2n} \end {align*}

The solution becomes\begin {align*} R_{n}\left ( r\right ) & =C_{n}r^{n}+C_{n}a^{2n}\frac {1}{r^{n}}\qquad n=1,2,3,\cdots \\ & =C_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \end {align*}

Hence the complete solution for \(R\left ( r\right ) \) is\begin {equation} R\left ( r\right ) =C_{0}+\sum _{n=1}^{\infty }C_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \tag {6} \end {equation} Using (5),(6)  gives\begin {align*} u_{n}\left ( r,\theta \right ) & =R_{n}\Theta _{n}\\ u\left ( r,\theta \right ) & =\left [ C_{0}+\sum _{n=1}^{\infty }C_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \right ] \left [ A_{0}+\sum _{n=1}^{\infty }A_{n}\cos \left ( n\theta \right ) +B_{n}\sin \left ( n\theta \right ) \right ] \\ & =D_{0}+\sum _{n=1}^{\infty }A_{n}\cos \left ( n\theta \right ) C_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) +\sum _{n=1}^{\infty }B_{n}\sin \left ( n\theta \right ) C_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \end {align*}

Where \(D_{0}=C_{0}A_{0}\). To simplify more, \(A_{n}C_{n}\) is combined to \(A_{n}\) and \(B_{n}C_{n}\) is combined to \(B_{n}\). The full solution is\[ u\left ( r,\theta \right ) =D_{0}+\sum _{n=1}^{\infty }A_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \cos \left ( n\theta \right ) +\sum _{n=1}^{\infty }B_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \sin \left ( n\theta \right ) \] The final nonhomogeneous B.C. is applied.\begin {align*} u\left ( b,\theta \right ) & =g\left ( \theta \right ) \\ g\left ( \theta \right ) & =D_{0}+\sum _{n=1}^{\infty }A_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \cos \left ( n\theta \right ) +\sum _{n=1}^{\infty }B_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \sin \left ( n\theta \right ) \end {align*}

For \(n=0\), integrating both sides give\begin {align*} \int _{-\pi }^{\pi }g\left ( \theta \right ) d\theta & =\int _{-\pi }^{\pi }D_{0}d\theta \\ D_{0} & =\frac {1}{2\pi }\int _{-\pi }^{\pi }g\left ( \theta \right ) d\theta \end {align*}

For \(n>0\), multiplying both sides by \(\cos \left ( m\theta \right ) \) and integrating gives\begin {align*} \int _{-\pi }^{\pi }g\left ( \theta \right ) \cos \left ( m\theta \right ) d\theta & =\int _{-\pi }^{\pi }D_{0}\cos \left ( m\theta \right ) d\theta \\ & +\int _{-\pi }^{\pi }\sum _{n=1}^{\infty }A_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \cos \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta \\ & +\int _{-\pi }^{\pi }\sum _{n=1}^{\infty }B_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \cos \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \end {align*}

Hence\begin {align} \int _{-\pi }^{\pi }g\left ( \theta \right ) \cos \left ( m\theta \right ) d\theta & =\int _{-\pi }^{\pi }D_{0}\cos \left ( m\theta \right ) d\theta \nonumber \\ & +\sum _{n=1}^{\infty }A_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \int _{-\pi }^{\pi }\cos \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta \nonumber \\ & +\sum _{n=1}^{\infty }B_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \int _{-\pi }^{\pi }\cos \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \tag {7} \end {align}

But \begin {align*} \int _{-\pi }^{\pi }\cos \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta & =\pi \qquad n=m\neq 0\\ \int _{-\pi }^{\pi }\cos \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta & =0\qquad n\neq m \end {align*}

And\[ \int _{-\pi }^{\pi }\cos \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta =0\qquad \] And\[ \int _{-\pi }^{\pi }D_{0}\cos \left ( m\theta \right ) d\theta =0 \] Then (7) becomes\begin {align} \int _{-\pi }^{\pi }g\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta & =\pi A_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \nonumber \\ A_{n} & =\frac {1}{\pi }\frac {\int _{-\pi }^{\pi }g\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta }{b^{n}+\frac {a^{2n}}{b^{n}}} \tag {8} \end {align}

Again, multiplying both sides by \(\sin \left ( m\theta \right ) \) and integrating gives\begin {align*} \int _{-\pi }^{\pi }g\left ( \theta \right ) \sin \left ( m\theta \right ) d\theta & =\int _{-\pi }^{\pi }D_{0}\sin \left ( m\theta \right ) d\theta \\ & +\int _{-\pi }^{\pi }\sum _{n=1}^{\infty }A_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \sin \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta \\ & +\int _{-\pi }^{\pi }\sum _{n=1}^{\infty }B_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \sin \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \end {align*}

Hence\begin {align} \int _{-\pi }^{\pi }g\left ( \theta \right ) \sin \left ( m\theta \right ) d\theta & =\int _{-\pi }^{\pi }D_{0}\sin \left ( m\theta \right ) d\theta \nonumber \\ & +\sum _{n=1}^{\infty }A_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \int _{-\pi }^{\pi }\sin \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta \nonumber \\ & +\sum _{n=1}^{\infty }B_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \int _{-\pi }^{\pi }\sin \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \tag {9} \end {align}

But \begin {align*} \int _{-\pi }^{\pi }\sin \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta & =\pi \qquad n=m\neq 0\\ \int _{-\pi }^{\pi }\sin \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta & =0\qquad n\neq m \end {align*}

And\[ \int _{-\pi }^{\pi }\sin \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta =0 \] And\[ \int _{-\pi }^{\pi }D_{0}\sin \left ( m\theta \right ) d\theta =0 \] Then (9) becomes\begin {align*} \int _{-\pi }^{\pi }g\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta & =\pi B_{n}\left ( b^{n}+\frac {a^{2n}}{b^{n}}\right ) \\ B_{n} & =\frac {1}{\pi }\frac {\int _{-\pi }^{\pi }g\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta }{b^{n}+\frac {a^{2n}}{b^{n}}} \end {align*}

This complete the solution. Summary\begin {align*} u\left ( r,\theta \right ) & =D_{0}+\sum _{n=1}^{\infty }A_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \cos \left ( n\theta \right ) +\sum _{n=1}^{\infty }B_{n}\left ( r^{n}+\frac {a^{2n}}{r^{n}}\right ) \sin \left ( n\theta \right ) \\ D_{0} & =\frac {1}{2\pi }\int _{-\pi }^{\pi }g\left ( \theta \right ) d\theta \\ A_{n} & =\frac {1}{\pi }\frac {\int _{-\pi }^{\pi }g\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta }{b^{n}+\frac {a^{2n}}{b^{n}}}\\ B_{n} & =\frac {1}{\pi }\frac {\int _{-\pi }^{\pi }g\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta }{b^{n}+\frac {a^{2n}}{b^{n}}} \end {align*}

____________________________________________________________________________________

4.1.2.9 [313] Circular annulus

problem number 313

Solve Laplace equation \[ u_{rr} + \frac {1}{r } u_r + \frac {1}{r^2} u_{\theta \theta } =0 \]

Inside circular annulus \(1<r<2\) subject to the following boundary conditions \begin {align*} u(1,\theta ) &= 0 \\ u(2,\theta ) &= \sin \theta \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta], {r, 2}] + (1*D[u[r, theta], r])/r + (1*D[u[r, theta], {theta, 2}])/r^2 == 0; 
bc  = {u[1, theta] == 0, u[2, theta] == Sin[theta]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {2 \left (r^2-1\right ) \sin (\theta )}{3 r} & 1\leq r\leq 2 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
pde := diff(u(r,theta),r$2)+1/r*diff(u(r,theta),r)+1/r^2*diff(u(r,theta),theta$2)=0; 
bc  := u(1,theta)=0,u(2,theta)=sin(theta); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(r,theta))),output='realtime'));
 

\[u \left ( r,\theta \right ) ={\frac {2\,\sin \left ( \theta \right ) \left ( {r}^{2}-1 \right ) }{3\,r}}\]

____________________________________________________________________________________

4.1.2.10 [314] Outside a disk

problem number 314

Solve Laplace equation in polar coordinates outside a disk

Solve for \(u\left ( r,\theta \right ) \) \begin {align*} u_{rr}+\frac {1}{r} u_r +\frac {1}{r^2} u_{\theta \theta } & =0\\ a & \leq r \\ 0 & <\theta \leq 2\pi \end {align*}

Boundary conditions \begin {align*} u\left ( a,\theta \right ) & =f\left ( \theta \right ) \\ \left \vert u\left ( 0,\theta \right ) \right \vert & <\infty \\ u\left ( r,0\right ) & =u\left ( r,2\pi \right ) \\ \frac {\partial u}{\partial \theta }\left ( r,0\right ) & =\frac {\partial u}{\partial \theta }\left ( r,2\pi \right ) \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta], {r, 2}] + 1/r*D[u[r, theta], r] + 1/r^2*D[u[r, theta], {theta, 2}] == 0; 
bc  = {u[a, theta] == f[theta], u[r, -Pi] == u[r, Pi], Derivative[0, 1][u][r, -Pi] == Derivative[0, 1][u][r, Pi]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> {a > 0, r > a}], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \underset {K[1]=1}{\overset {\infty }{\sum }}\frac {a^{-K[1]} r^{K[1]} \left (\cos (\theta K[1]) \int _{-\pi }^{\pi } \frac {\cos (\theta K[1]) f(\theta )}{\sqrt {\pi }} \, d\theta +\left (\int _{-\pi }^{\pi } \frac {f(\theta ) \sin (\theta K[1])}{\sqrt {\pi }} \, d\theta \right ) \sin (\theta K[1])\right )}{\sqrt {\pi }}+\frac {\int _{-\pi }^{\pi } \frac {f(\theta )}{\sqrt {2 \pi }} \, d\theta }{\sqrt {2 \pi }}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(r, theta), r$2) + 1/r* diff(u(r,theta),r) + 1/r^2* diff(u(r, theta), theta$2) = 0; 
bc  := u(a, theta) = f(theta), u(r, -Pi) = u(r, Pi), (D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta), HINT = boundedseries(r=infinity))),output='realtime'));
 

\[u \left ( r,\theta \right ) ={\frac {1}{2\,\pi } \left ( 2\,\sum _{n=1}^{\infty } \left ( {\frac {\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \cos \left ( n\theta \right ) \,{\rm d}\theta \cos \left ( n\theta \right ) +\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \sin \left ( n\theta \right ) \,{\rm d}\theta \sin \left ( n\theta \right ) }{\pi } \left ( {\frac {r}{a}} \right ) ^{-n}} \right ) \pi +\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \,{\rm d}\theta \right ) }\]

____________________________________________________________________________________

4.1.2.11 [315] Outside a disk

problem number 315

Added January 13, 2020

Laplace PDE in polar coordinates outside a disk

Solve \(u_{xx}+u_{yy}=0\) outside disk \(x^{2}+y^{2}>1\) with boundary condition \(xy^{2}\) when \(x^{2}+y^{2}=a\). Where \(a=1\) in this problem. Express solution in \(x,y\)

The first step is to convert the boundary condition to polar coordinates. Since \(x=r\cos \theta ,y=r\sin \theta \), then at the boundary \(u\left ( r,\theta \right ) =r\cos \theta \left ( r\sin \theta \right ) ^{2}\). But \(r=1\) (the radius). Hence at the boundary, \(u\left ( 1,\theta \right ) =f\left ( \theta \right ) \) where \begin {align*} f\left ( \theta \right ) & =\cos \theta \sin ^{2}\theta \\ & =\cos \theta \left ( 1-\cos ^{2}\theta \right ) \\ & =\cos \theta -\cos ^{3}\theta \end {align*}

But \(\cos ^{3}\theta =\frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \). Therefore the above becomes\begin {align} f\left ( \theta \right ) & =\cos \theta -\left ( \frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \right ) \nonumber \\ & =\frac {1}{4}\cos \theta -\frac {1}{4}\cos 3\theta \tag {1} \end {align}

The above is also seen as the Fourier series of \(f\left ( \theta \right ) \). The PDE in polar coordinates is\[ u_{rr}+\frac {1}{r}u_{r}+\frac {1}{r^{2}}u_{\theta \theta }=0 \]

Mathematica

ClearAll["Global`*"]; 
a=1; 
pde = Laplacian[u[r, theta], {r, theta}, "Polar"] == 0; 
f[theta_] := 1/4*(Cos[theta] - Cos[3*theta]); 
bc = {u[a, theta] == f[theta], u[r, -Pi] == u[r, Pi], Derivative[0, 1][u][r, -Pi] == Derivative[0, 1][u][r, Pi]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> r > a], 60*10]];
 

\[\left \{\left \{u(r,\theta )\to \frac {1}{4} \left (r \cos (\theta )-r^3 \cos (3 \theta )\right )\right \}\right \}\]

Maple

restart; 
f:=theta-> 1/4*(cos(theta) - cos(3*theta)); 
a:=1; 
pde := VectorCalculus:-Laplacian(u(r,theta),'polar'[r,theta]); 
bc := u(a, theta) = f(theta),u(r, -Pi) = u(r, Pi),(D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta), HINT = boundedseries(r=infinity))),output='realtime')); 
sol:=simplify(subs(cos(theta)^3=trigsubs(cos(theta)^3)[2],expand(sol)),size);
 

\[u \left ( r,\theta \right ) ={\frac {\cos \left ( \theta \right ) {r}^{2}-\cos \left ( 3\,\theta \right ) }{4\,{r}^{3}}}\]

Hand solution

The first step is to convert the boundary condition to polar coordinates. Since \(x=r\cos \theta ,y=r\sin \theta \), then at the boundary \(u\left ( r,\theta \right ) =r\cos \theta \left ( r\sin \theta \right ) ^{2}\). But \(r=1\) (the radius). Hence at the boundary, \(u\left ( 1,\theta \right ) =f\left ( \theta \right ) \) where \begin {align*} f\left ( \theta \right ) & =\cos \theta \sin ^{2}\theta \\ & =\cos \theta \left ( 1-\cos ^{2}\theta \right ) \\ & =\cos \theta -\cos ^{3}\theta \end {align*}

But \(\cos ^{3}\theta =\frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \). Therefore the above becomes\begin {align} f\left ( \theta \right ) & =\cos \theta -\left ( \frac {3}{4}\cos \theta +\frac {1}{4}\cos 3\theta \right ) \nonumber \\ & =\frac {1}{4}\cos \theta -\frac {1}{4}\cos 3\theta \tag {1} \end {align}

The above is also seen as the Fourier series of \(f\left ( \theta \right ) \). The PDE in polar coordinates is\[ u_{rr}+\frac {1}{r}u_{r}+\frac {1}{r^{2}}u_{\theta \theta }=0 \] The solution is known to be\begin {equation} u\left ( r,\theta \right ) =\frac {c_{0}}{2}+\sum _{n=1}^{\infty }r^{-n}\left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \tag {2} \end {equation} Since the above solution is the same as \(f\left ( \theta \right ) \) when \(r=1\), then equating (2) when \(r=1\) to (1) gives\[ \frac {1}{4}\cos \theta -\frac {1}{4}\cos 3\theta =\frac {c_{0}}{2}+\sum _{n=1}^{\infty }\left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \] By comparing terms on both sides, this shows by inspection that\begin {align*} c_{0} & =0\\ c_{1} & =\frac {1}{4}\\ c_{3} & =\frac {-1}{4} \end {align*}

And all other \(c_{n},k_{n}\) are zero. Using the above result back in (2) gives the solution as \begin {align} u\left ( r,\theta \right ) & =\frac {r^{-1}}{4}\cos \theta -\frac {r^{-3}}{4}\cos 3\theta \nonumber \\ & =\frac {r^{2}\cos \left ( \theta \right ) -\cos \left ( 3\theta \right ) }{4r^{3}}\tag {3} \end {align}

This is 3D plot of the solution

pict

This is a contour plot

pict