First of all, due to the geometry of the slab, you can write that the electric field E vector is directed by the x axis, and depends only on x. You can write : E = E(x)*ux, with ux being the elementary vector of the x axis.
This being said, let x0 be some real such that |x0| < d/2 (inside the slab). The Gauss theorem applied on a slab such that : 2*x0 is the width, h is the height, l is the length (both h and l are arbitrary, you dont' need a value as explained below) provides :
E(x0)*l*h + E(-x0)*l*h = Q/e0, Q being the total electric charge contained by the slab, and e0 being the vaccum permittivity.
Q is the integral over the slab of the density p which is equal to :
Q = 2*l*h*1/7*x0^7
Finally : E(x0) = x0^7/(7*e0)
Outside the slab, the field is constant equal to :
E(x) = (d/2)^7/(7*e0)
Might be wrong / unclear.