This integration proof is given in by EM book.
Find the Electric field by a infinite long wire given it is uniformly charged and have $\lambda$ as its linear charge density.
Proof :-
$$dE_y = {dq\over R^2 }\cos \theta = {\lambda dx\over R^2 }\cos \theta$$
The wire is assumed to lie on x-axis and a point charge is placed on y-axis. A small section $dx$ of the wire is taken which is assumed to contain $dq$.The y-component of electric field induced by $dq$ on the place charge is given by the above.
Since the wire is uniform $dq = \lambda dx$, hence we got the above equation.
Now they took the integral of both sides,
$$E_y = \int^\infty_{-\infty} {\lambda dx\over R^2 }\cos \theta$$
I understand how we get the limits of this integral, since the wire is infinitely long we get $\infty$ on +ve x-axis and $-\infty$ on -ve axis.
Then for a small displacement the arclength and the chord of a circle will be same, thus we get $Rd\theta = dx$.
$$E_y = \int^{\pi/2}_{-\pi/2} {\lambda d\theta\over R }\cos \theta$$
I get we changed the variable to $\theta(x), \theta^{'}(x) = 1/R$
So it should be,
$$E_y = \int^\infty_{-\infty} {\lambda dx\over R^2 }\cos \theta = \lim_{x \to \infty} \int^{\theta(x)}_{\theta(-x)} {\lambda d\theta\over R }\cos \theta$$
But why does $\lim_{x\to \infty}\theta(x) = \pi/2$ ? I know $\theta$ is function that gives angle in radian for a given arc length, it means angle approaches $\pi/2$ when arclength is becomes very large.