Answer
See the detailed answer below.
Work Step by Step
We know that the electric field due to a continuous charge distribution is given by
$$E=\dfrac{1}{4\pi \epsilon_0}\int_0^r\dfrac{1}{r^2}dq$$
Let's assume that the linear charge density of this rod is $\lambda$ which is given by
$$\lambda=\dfrac{Q}{L}=\dfrac{dq}{dy}$$
where $dL$ is the length of the small black part in the figure below and $dx$ is its length.
Thus,
$$dq=\dfrac{Qdy}{L}\tag 1$$
So the electric field due to this small segment, as seen in the figure below, is given by
$$dE=\dfrac{1}{4\pi \epsilon_0} \bigg[\dfrac{dq}{ r^2}(\cos\theta\;\hat i-\sin\theta \hat j)\bigg] $$
where $\sin\theta=y/r$, and $\cos\theta=x/r$,
$$dE=\dfrac{1}{4\pi \epsilon_0} \bigg[\dfrac{dq}{ r^3}(x\;\hat i-y\;\hat j)\bigg] $$
where $r=\sqrt{x^2+y^2}$
$$dE=\dfrac{1}{4\pi \epsilon_0} \bigg[\dfrac{dq}{ (x^2+y^2)^{3/2}}(x\;\hat i-y\;\hat j)\bigg] $$
$$dE=\dfrac{dq}{4\pi \epsilon_0} \bigg[\dfrac{ x}{ (x^2+y^2)^{3/2}}\;\hat i-\dfrac{ y}{ (x^2+y^2)^{3/2}}\;\hat j \bigg] $$
Plug $dq$ from (1),
$$dE=\dfrac{(Q/L)dy}{(4\pi \epsilon_0 ) } \bigg[\dfrac{ x}{ (x^2+y^2)^{3/2}}\;\hat i-\dfrac{ y}{ (x^2+y^2)^{3/2}}\;\hat j \bigg] $$
$$dE=\dfrac{Q/L }{(4\pi \epsilon_0 ) } \bigg[\dfrac{ xdy}{ (x^2+y^2)^{3/2}}\;\hat i-\dfrac{ ydy}{ (x^2+y^2)^{3/2}}\;\hat j \bigg] $$
For the electric field from the rod, we need to take the integral for both sides,
$$E=\dfrac{Q/L }{(4\pi \epsilon_0 ) } \bigg[\int_0^L\dfrac{ xdy}{ (x^2+y^2)^{3/2}}\;\hat i-\int_0^L\dfrac{ ydy}{ (x^2+y^2)^{3/2}}\;\hat j \bigg] $$
$$E=\dfrac{Q/L }{(4\pi \epsilon_0 ) } \bigg[ \dfrac{ xy}{ x^2\sqrt{x^2+y^2} } \;\hat i- \dfrac{ -1}{ \sqrt{x^2+y^2}}\;\hat j \bigg]_0^L $$
$$E=\dfrac{Q/L }{(4\pi \epsilon_0 ) } \bigg[ \left(\dfrac{ L}{ x \sqrt{x^2+L^2} } -0 \right)\;\hat i+ \left(\dfrac{ 1}{ \sqrt{x^2+L^2}}-\dfrac{ 1}{ \sqrt{x^2+0}}\right)\;\hat j \bigg] $$
$$E= \left(\dfrac{ Q}{(4\pi \epsilon_0 ) x \sqrt{x^2+L^2} } \right)\;\hat i+\\
\dfrac{Q }{(4\pi \epsilon_0 ) L} \left(\dfrac{ 1}{ \sqrt{x^2+L^2}}-\dfrac{ 1}{x}\right)\;\hat j $$
where
$$ \bigg(\dfrac{ 1}{ \sqrt{x^2+L^2}}-\dfrac{ 1}{x}\bigg) =
\dfrac{x-\sqrt{x^2+L^2}}{x\sqrt{x^2+L^2}} =
\dfrac{1}{x}\left[ \dfrac{x}{\sqrt{x^2+L^2}}-1\right] $$
Thus,
$$E= \boxed{\left(\dfrac{ Q}{(4\pi \epsilon_0 ) x \sqrt{x^2+L^2} } \right)\;\hat i}+\\
\boxed{ \dfrac{Q }{(4\pi \epsilon_0 ) xL} \left[ \dfrac{x}{\sqrt{x^2+L^2}}-1\right]\;\hat j }$$