Let AB is the rod having L as its length. Let z is the distance from the middle of the rod. P is the point where electric field is to obtain. Let this distance is x.
The general expression for electric field is
E(P)=14πε0∫lineQr2
∵λ=QL
Q=CxL(given)
So, E(P)=14πε0∫lineCxLr2
Electric field at point P due to E1 and E2
E(P)=E1cosθ+E2cosθ
∵|E1|=|E2|=E
E(P)=2Ecosθ
E(P)=14πε0l2∫0Cxdxr2
After solving the expression, the final electric field at point P is
E(P)=14πε0CLz√z2+L24