Calculating the electrostatic energy per unit length of a cylindrical shell surrounded by a coaxial cable
Suppose an infinitely long cylindrical shell of radius $a$ carries a surface charge density $\sigma_0$ and is surrounded by a coaxial cable of inner radius $b$ and outer radius $c$ with uniform charge density $\rho_0$ such that the combined system is neutral.
I am asked to calculate the electrostatic energy in two equivalent ways, using $$W=\frac{1}{2}\int\rho V\,\mathrm{d}\tau$$ and $$W=\frac{\epsilon_0}{2}\int E^2\,\mathrm{d}\tau.$$ For some reason, which I have struggled (in vain) to locate, I am not obtaining the same result, and I would appreciate it if someone could help locate precisely what went wrong.
I think this is rather trivial, but it is tedious, and I must have overlooked something somewhere, embarrassingly enough.
First, I calculate $\rho_0$ in terms of $\sigma_0$. Consider some length $L$ along the system. The charge along the inner shell is $2\pi aL\sigma_0$ and the charge along the coaxial cable is $\pi c^2L\rho_0-\pi b^2L\rho_0=\pi L\rho_0(c^2-b^2)$. Setting their sum to be equal to 0, $$\rho_0=-\frac{2a\sigma_0}{c^2-b^2}$$
Next, I apply <PERSON>'s law to find the electric field of the inner cylindrical shell and of the coaxial cable independently and sum them together to obtain the electric field for the system as a whole.
Consider first the inner cylindrical shell and construct a Gaussian cylinder of length L. Due to symmetry, the electric field must only point in the $\hat{\mathbf{s}}$ direction and is a function of $s$ only. 903
For $sa$, the charge enclosed is $Q=2\pi aL\sigma_0$, so $|\mathbf{E}|2\pi sL=Q/\epsilon_0$ yields $\mathbf{E}=(a\sigma_0/s\epsilon_0)\hat{\mathbf{s}}$.
Then consider the coaxial cable and a Gaussian cylinder of length L. Inside the cable, <PERSON>'s law tells us the electric field is 0. For $b<sc$, it is $\mathbf{E}=(\rho_0/\epsilon_0)(c^2-b^2)(1/2s)\hat{\mathbf{s}}$.
Now, I combine these expressions to arrive at a piecewise function for the electric field.
$$ \mathbf{E}(\mathbf{r})=\left{ \begin{array}{lr} 0 & s<a\ \frac{a\sigma_0}{s\epsilon_0}\hat{\mathbf{s}} & a<s<b\ \frac{a\sigma_0}{\epsilon_0}\frac{1}{s}\left(1+\frac{s^2-b^2}{b^2-c^2}\right)\hat{\mathbf{s}} & b<s<c\ 0 & c<s \end{array} \right. $$
Now, from the electric field, we will calculate the potential, taking $\infty$ as our reference point and working our way inwards, to speak. The potential for $s>c$ is of course 0, because the electric field there is also 0.
Suppose that $b<s<c$. Then the potential is $V=V_1(s)$, where $$ \begin{align} V_1(s)&=-\int_c^s\left(\frac{a\sigma_0}{s'\epsilon_0}+\frac{\rho_0(s'^2-b^2)}{2s'\epsilon_0}\right)\,ds'=-\frac{a\sigma_0}{\epsilon_0}\int_c^s\frac{1}{s'}\left(1+\frac{s'^2-b^2}{b^2-c^2}\right)\,ds'=-\frac{a\sigma_0}{\epsilon_0}\left. 903