Solving Basic Linear Partial Differential Equation I am solving the PDE $$\bigtriangleup u = 0,\ u(1,\ \theta) = \sin^2\theta$$
I plugged $u = R(r)T(\theta)$ into the polar Laplacian formula, and ended up with $\frac{r^2}{R}\frac{\partial^2 R}{\partial r^2} + \frac{r}{R}\frac{\partial R}{\partial r} = -\frac{1}{T}\frac{\partial^2 T}{\partial \theta^2} = \lambda$.  My solutions to the Sturm-Louiville problems are $R = Ar^{-\sqrt\lambda} + Br^{\sqrt\lambda}$ and $T = Ce^{-\sqrt{-\lambda}\theta} + De^{\sqrt{-\lambda}\theta}$ (I have ruled out the $\lambda = 0$ case).  Thus I have $u = (Ar^{-\sqrt\lambda} + Br^{\sqrt\lambda})(Ce^{-\sqrt\lambda\theta i} + De^{\sqrt\lambda\theta i})$, or by Euler's Formula $$u = (Ar^{-\sqrt\lambda} + Br^{\sqrt\lambda})(C\cos(\sqrt\lambda \theta) + D\sin(\sqrt\lambda \theta))$$
I have heard several explanations for the next step, but the way it makes sense in my head (correct me if I'm wrong) is that we know the domain is a disk, because the given boundary condition describes a shape with constant radius which implies a circle, and a disk domain in turn implies that $u(r,\ \theta) = u(r,\ \theta + 2m\pi)$ for all $r$, $\theta$, and $m$, where $m$ is an arbitrary integer.  This is like having an extra boundary condition for every $m$, and plugging into general solution yields $(Ar^{-\sqrt\lambda} + Br^{\sqrt\lambda})(C\cos(\sqrt\lambda \theta) + D\sin(\sqrt\lambda \theta)) = (Ar^{-\sqrt\lambda} + Br^{\sqrt\lambda})(C\cos(\sqrt\lambda (\theta + 2m\pi)) + D\sin(\sqrt\lambda (\theta + 2m\pi)))$
Since this must hold for all $r$, not just the special case where $(Ar^{-\sqrt\lambda} + Br^{\sqrt\lambda}) = 0$, I can divide by this factor to get $C\cos(\sqrt\lambda \theta) + D\sin(\sqrt\lambda \theta) = C\cos(\sqrt\lambda (\theta + 2m\pi)) + D\sin(\sqrt\lambda (\theta + 2m\pi))$, which has solutions $(C\ $arbitrary$, D\ $arbitrary$, \lambda = n^2)$, where $n$ is any integer, and $(C = 0, D = 0, \lambda\ $arbitrary$)$.  The latter leads to $u = 0$ so let us proceed with $\lambda = n^2$, which gives $$u = \sum_{n = 0}^\infty (Ar^{-n} + Br^n)(C\cos(n \theta) + D\sin(n \theta))$$
Now applying the actual boundary condition produces $\sin^2\theta = \sum_{n = 0}^\infty (A + B)(C\cos(n \theta) + D\sin(n \theta))$, or $\sin^2\theta = \sum_{n = 0}^\infty E\cos(n \theta) + F\sin(n \theta)$ where $E = AC + BC$ and $F = AD + BD$.  All Fourier Series terms are $0$ except at $n = 0$ and $n = 2$, which yield $E = \frac{1}{2} \implies C = \frac{1}{2A + 2B}$ and $E = -\frac{1}{2} \implies C = -\frac{1}{2A + 2B}$, respectively, and so $$u = \frac{(Ar^{-n} + Br^n)(1 - cos(2\theta))}{2A + 2B}$$
I am stuck here.  I am out of boundary conditions and still have two arbitrary constants in the answer.  Even if I set $A = 0$ and only consider solutions consistent with the steady temperature physical application of this equation, $B$ remains, and I would prefer to solve the problem purely mathematically.  How can I continue solving the problem from here?
 A: I think there is a problem with your last expression of $u$. If I follow your calculations and if I'm not mistaken (correct me if so), at the end I get:
$$u(r,\theta)=\frac{1}{2}-\frac{\cos(2\theta)\left(A\frac{1}{r^2}+Br^2\right)}{2(A+B)}$$
From there, if you stick to the physical interpretation, it would be pretty weird to have an infinite temperature at $r=0$. Hence we can agree on the condition:
$$|u(0,\theta)|<+\infty$$
It is easy to see that this implies $A=0$ (else there is a singularity at $r=0$), which provides:
$$u(r,\theta)=\frac{1}{2}-\frac{\cos(2\theta)\left(Br^2\right)}{2B}$$
And finally $B$ cancels out !
$$u(r,\theta)=\frac{1}{2}\left(1-\cos(2\theta)r^2 \right)$$
A: One may show that in general given a PDE of the form
$$\boldsymbol{\triangle}u=0~~|~~u(1,\theta)=f(\theta)$$
It is important to note that in order for our solution to be well behaved, we require that $f$ is bounded.
Where
$$(\boldsymbol \triangle u)(r,\theta)=\partial_r^2u(r,\theta)+\frac{1}{r}u(r,\theta)+\frac{1}{r^2}\partial_{\theta}^2u(r,\theta)$$
The solution is
$$u(r,\theta)=\frac{1}{2\pi}\int_{-\pi}^\pi f(\phi)~\operatorname{PK}(r,\theta-\phi)\mathrm d\phi \\ \text{for}~~r\neq 1$$
Where $\operatorname{PK}$ is the Poisson Kernel,
$$\operatorname{PK}(r,\theta)=\frac{1-r^2}{1+r^2-2r\cos\theta}$$
We can use the series solution you obtained in your working, but discard the $r^{-n}$ solutions (since we want $u$ to be defined $\forall (r,\theta)\in [0,1]\times[0,2\pi)$) to get
$$u(r,\theta)=\frac{a_0}{2}+\sum_{n=1}^\infty \left(a_nr^n\cos(n\theta)+b_nr^n\sin(n\theta)\right)$$
(I can fill in the details if you wish, but it's a straightforward application of separation of variables.)
Where the coefficients $a_n,b_n$ are defined as
$$a_n=\frac{1}{\pi}\int_{-\pi}^\pi f(\theta)\cos(n\theta)\mathrm d\theta$$
$$b_n=\frac{1}{\pi}\int_{-\pi}^\pi f(\theta)\sin(n\theta)\mathrm d\theta$$
So, what we do now is expand out our solution using our integrals:
$$u(r,\theta)=\frac{1}{2\pi}\int_{-\pi}^\pi f(\phi)\mathrm d\phi+\frac{1}{\pi}\sum_{n=1}^\infty r^n \left[\cos(n\theta)\int_{-\pi}^\pi f(\phi)\cos(n\phi)\mathrm d\phi+\sin(n\theta)\int_{-\pi}^\pi f(\phi)\sin(n\phi)\mathrm d\phi\right]$$
$$u(r,\theta)=\frac{1}{\pi}\int_{-\pi}^\pi f(\phi)\left(\frac{1}{2}+\sum_{n=1}^\infty r^n\left(\cos(n\theta)\cos(n\phi)+\sin(n\theta)\sin(n\phi)\right)\right)\mathrm d\phi$$
And using our cosine addition formula,
$$\cos(a+b)=\cos a\cos b-\sin a\sin b$$
We obtain
$$u(r,\theta)=\frac{1}{\pi}\int_{-\pi}^\pi f(\phi)\left(\frac{1}{2}+\sum_{n=1}^\infty r^n\cos(n(\theta-\phi))\right)\mathrm d\phi$$
Now, let's have a look at the sum
$$\sum_{n=1}^\infty r^n \cos(n(\theta-\phi))$$
Which converges for $|r|<1$. Using Euler's formula $e^{ix}=\cos x+i\sin x$ we can write
$$\sum_{n=1}^\infty r^n \cos(n(\theta-\phi))=\operatorname{Re}\left(\sum_{n=1}^\infty z^n\right)$$
Where $z=re^{i(\theta-\phi)}$.
So,
$$\frac{1}{2}+\sum_{n=1}^\infty r^n \cos(n(\theta-\phi))=\operatorname{Re}\left(\frac{1}{2}+\frac{z}{1-z}\right)$$
$$=\operatorname{Re}\left(\frac{1+z}{2(1-z)}\right)$$
Now a trick: we multiply top and bottom by $\overline{1-z}=1-\overline{z}$.
$$=\operatorname{Re}\left(\frac{(1+z)(1-\overline{z})}{2(1-z)(\overline{1-z})}\right)=\frac{\operatorname{Re}(1-\overline{z}+z-|z|^2)}{2|1-z|^2}=\frac{1-|z|^2}{2|1-z|^2}$$
$$=\frac{1-r^2}{2(1+r^2-2r\cos(\theta-\phi))}$$
Therefore, when $f=\sin^2$ we have
$$u(r,\theta)=\frac{1}{2\pi}\int_{-\pi}^\pi \sin^2\phi~\frac{1-r^2}{1+r^2-2r\cos(\theta-\phi)}\mathrm d\phi\\ \text{for}~~r\neq 1$$
Using @peek-a-boo's wonderful work we can solve this integral to obtain
$$u(r,\theta)=\frac{1-r^2\cos(2\theta)}{2}$$
It is an important question to ask, in general, given $f\in C^0(\mathbb{R})$ and our solution to our PDE as
$$u( r,\theta ) =\begin{cases}
\frac{1}{2\pi }\int _{-\pi }^{\pi } f( \phi ) \ \frac{1-r^{2}}{1+r^{2} -2r\cos( \theta -\phi )}\mathrm{d} \phi  & r\neq 1\\
f( \theta ) & r=1
\end{cases} \ \ ,\ \ ( r,\theta ) \in [ 0,1] \times [ 0,2\pi )$$
Whether the solution is well behaved at the boundary, that is whether
$$\lim_{r\to 1^-}u(r,\theta)=f(\theta)$$
There is discussion on this matter here, though personally I found it a bit hard to follow.
