# Is it really to solve problem below by using, in the main, Gauss law?

There is an infinite cylinder surface which uniformly charged along and has a surface charge density, which can be represented as $$\sigma = \sigma_{0}cos(\varphi ),$$ where $\varphi$ - polar angle in a cylindrical coordinate system (it means that z-axis is matches with cylinder axis). There need to find z-component $|\mathbf E|$.

I tried to learn use Gauss law, but tasks, where density isn't constant on the surface, are still hard for me. Can you help?

-
This isn't solveable with Gauss's Law. You're going to have to solve this with an integral. –  Jerry Schirmer Sep 10 '12 at 15:05
But how to "make" an integral? –  PhysiXxx Sep 10 '12 at 15:09

This is a superposition of two infintesimally displaced cylinders with a uniform charge density in the interior:

$$\rho(\theta) = \cos(\theta)$$

on the surface implies that $\rho(x,y,z)\propto x$ on the cylinder surface, so up to a factor

$$\rho(x,y) = ((x+\epsilon)^2 + y^2) - (x^2 + y^2)$$

Which is a superposition of two opposite charges. The solution for a uniform charge density is by Gauss's law:

$$\phi(x,y) \propto \log((x-a)^2+y^2))$$

for the exterior, and

$$\phi(x,y) \propto (x-a)^2 + y^2$$

on the interior, with the two solutions matching. You differentiate with respect to a and set a to zero to find the superposition solution for two infintesimally displaced cylinders of opposite charge density.

-
It seems to me that, due to the symmetry of the problem, $E_z$ vanishes identically. For example, the electric field can be regarded as an integral of electric fields created by homogeneously charged straight lines parallel to axis $z$, and it is obvious that $z$-component of electric field created by such a line vanishes due to the symmetry.