From the symmetry in the problem we see that the x-component of the electric field at the point P is zero and that the y-component of the electric field from the two rods is twice that from one of the rods as follows,

where I used dQ = λdx and cosθ = y/r with r2 = x2 + y2. Plugging in y = L/2 yields
