Potentials and Poisson equation Ok so I am very confused about these types of questions and tutorial solutions miss out a load of working so if someone could explain how to do this question in a very basic manner I'd really appreciate it!
Q: Solve the 2D Poisson equation for an azimuthally symmetric ($\theta$- independent) potential in polar coordinates,
$$\frac1r\frac d{dr}\left(r\frac{d\Phi(r)}{dr}\right)=-\rho(r)$$ 
where 
$$\rho=\begin{cases}a-r&,r\le a\\\\0&,r>a\end{cases}$$ 
subject to the boundary conditions $\Phi(0)=0$ and $\lim_{r\to \infty}\frac{\phi(r)}{r}=0$
 A: 
GENERAL APPROACH:

By directly integrating and applying the condition $\Phi(0)=0$ we find that 
$$\Phi(r)=-\int_0^r \frac1{r'} \int_0^{r'}r''\rho(r'')\,dr''\,dr'\tag 1$$
Changing the order of integration in $(1)$ yields
$$\begin{align}
\Phi(r)&=-\int_0^r r''\rho(r'')\int_{r''}^r \frac1{r'} \,dr'\,dr''\\\\
&=\bbox[5px,border:2px solid #C0A000]{\int_0^r r''\log(r''/r)\rho(r'')\,dr''}
\end{align}$$

Case for $\displaystyle \rho(r)=(a-r)u(a-r)$
If $r<a$, then 
$$\begin{align}
\Phi(r)&=\int_0^r r''\log(r''/r)(a-r'')\,dr''\\\\
&=\bbox[5px,border:2px solid #C0A000]{\frac19r^3-\frac14ar^2}\tag 2
\end{align}$$
If $r>a$, then 
$$\begin{align}
\Phi(r)&=\int_0^a r''\log(r''/r)(a-r'')\,dr''\\\\
&=\bbox[5px,border:2px solid #C0A000]{a^3\left(\frac16 \log(a/r)-\frac5{36}\right)}\tag3
\end{align}$$


DIRECT APPROACH:

Another way forward is to write for $r\le a$
$$\frac1r\frac d{dr}\left(r\frac{d\Phi(r)}{dr}\right)=-(a-r)\tag 4$$
Then, multiplying $(4)$ by $r$ and integrating we find that 
$$r\frac{d\Phi(r)}{dr}=-\frac12ar^2+\frac13r^3\tag 5$$
Dividing $(5)$ by $r$ and integrating we find that 
$$\bbox[5px,border:2px solid #C0A000]{\Phi(r)=-\frac14 ar^2+\frac19r^3} \tag6$$
which agrees with $(2)$!
For $r\ge a$, we can write
$$\frac1r\frac d{dr}\left(r\frac{d\Phi(r)}{dr}\right)=0\tag 7$$
Then, multiplying $(7)$ by $r$ and integrating we find that 
$$r\frac{d\Phi(r)}{dr}=a\frac{d\Phi(a)}{da}\tag 8$$
Dividing $(8)$ by $r$ and integrating we find that 
$$\Phi(r)=a\frac{d\Phi(a)}{da}\log(a/r)+\Phi(a)\tag 9$$
Using $(6)$ to find $\Phi(a)$ and $\frac{d\Phi(a)}{da}$ yields
$$\begin{align}
\bbox[5px,border:2px solid #C0A000]{\Phi(r)=a^3\left(\frac16 \log(a/r)-\frac5{36}\right)}\tag{10}
\end{align}$$
which agrees with $(3)$!
