# Query regarding solution to a Griffith's Problem

I was solving the following problem from Griffith's Electrodynamics 3rd edition:

Q.$$4.13$$ : A very long cylinder of radius $$a$$ carries a uniform polarisation $$P$$ perpendicular to the axis. Find the electric field inside and outside the cylinder.

My Attempt:

Since $$P$$ is uniform, so $$\rho_b=0$$ and $$\sigma_b=\vec P\cdot \hat n=\vec P\cdot \hat s=P \cos \theta$$

Now we consider 2 Gaussian cylinders of length $$a$$ and radius $$r$$, $$r in cylinder $$1$$ and $$r>a$$ in cylinder $$2$$.

Applying Gauss' Law, for $$r, \begin{align}\vec E\cdot {\mathrm d\vec A}=\oint \frac{1}{\epsilon_0}Q_\textrm{enc} &=\frac{1}{\epsilon_0} \int_V \rho_b \,\, ~\mathrm dV=0\\ \implies \vec E &=\vec 0\end{align}

Applying Gauss' Law, for $$r, \begin{align}\vec E\cdot {\mathrm d\vec A}=\oint \frac{1}{\epsilon_0}Q_\textrm{enc} &=\frac{1}{\epsilon_0} \left(\int_V\rho_b \,\,~\mathrm dV + \int_S \sigma_b ~\mathrm dA\right)\\ \implies E\cdot 2\pi rl &=\frac{1}{\epsilon_0} (0 + P \cos \theta \cdot 2\pi a l)\\ \implies~~~~~~~~~~ \vec E &=\frac{Pa\cos \theta}{\epsilon_0r} \hat s \end{align}

But Griffith's is providing a different solution which is entirely different from mine and which I can't understand at all.  Can someone explain why I am wrong or if I am wrong at all?

First of all, I think you have a problem with your notation. Gauss' Law should read $$\int_{\partial V} \vec{E} \cdot d\vec{S} = \frac{q_{\text{enc}}}{\epsilon_{0}},$$ where the enclosed charge can be written as $$q_{\text{enc}} = \int_{V}\rho(\vec{r}^{\, \prime}) dV^{\prime}.$$ It is very important that you remember this.
On the other hand, once you set $\sigma_{b} = P \cos \theta$, you should be able to use separation of variables to solve Laplace's equation to obtain the potential in both regions, and then you can compute the electric field by simply taking its gradient.
Here $$\rho_b=0$$ but $$\rho_{free}$$ is not zero. In order to use gauss law, you have to consider total charge, i,e, free and bound charge.