Getting electric potential from charge density over whole space? Let’s say I have got a charge density $\rho (x,y,z)=\cfrac{C}{x^2}$ with C a specific constant. I want to know the potential on every point in space. How can I get an expression of the electric potential in terms of position? 
Plotting the charge density we get of course infinite amount of planes with the same charge density each, along the x-axis. With this picture in mind we might guess that there are just x-components of the electric fields perpendicular to the planes, because of symmetry.
I think that this could be a key point (if I was right) in calculating the potential (or electric field) but I just can’t come up with a specific expression for that since I would have to consider all planes with specific charge density. Neither Gauss Law, Coulomb’s law or any other definition of potential/electric fields seems to be applicable.
Is there a simple way to calculate such a potential? (It actually doesn’t seems to be that hard)
 A: Calculating potentials from a given charge density can be done via 
\begin{align}
\phi(\vec{r})= \frac{1}{4\pi \epsilon_0} \int_\mathbb{R} d^3 r' \frac{\rho(\vec{r}')}{|\vec{r}-\vec{r}'|} \, .
\end{align}
This follows from a general version of Coulomb's law 
\begin{align}
\vec{E}(\vec{r})= \frac{1}{4\pi \epsilon_0} \int_\mathbb{R} d^3\vec{r}' \rho(\vec{r}')\frac{\vec{r}-\vec{r}'}{|\vec{r}-\vec{r}'|^3}
\end{align}
and the definition of the potential 
\begin{align}
\vec{E}(\vec{r})=-\vec{\nabla}\phi(\vec{r}) \, .
\end{align}
Make sure that, while integrating over $\mathbb{R}$ in every space direction of this volume integral, you dont forget to put the correct Dirac delta function into your charge density (otherwise its dimension is not correct)
\begin{align}
\rho(\vec{r})=\frac{C}{x^2} \delta(y) \delta(z) \, .
\end{align}
As \begin{align}
|\vec{r}-\vec{r}'| = \sqrt{(x-x')^2+(y-y')^2+(z-z')^2}
\end{align}
and the Dirac delta functions property
\begin{align}
\int_\mathbb{R} du f(u) \delta(u-u_0) = f(u_0)
\end{align}
hold, we can enter everything and the problem reduces to solving
\begin{align}
\phi(\vec{r})= \frac{C}{4\pi \epsilon_0} \int_{-\infty}^\infty dx' \frac{1}{x'^2 \sqrt{(x-x')^2+y^2+z^2}} \, .
\end{align}
The rest then is just maths and maybe knowing the occasional $|\vec{r}|=r=\sqrt{x^2+y^2+z^2}$. 
I hope this helped.
