This approach has the toughest trigonometry!!!
Assuming a uniform charge distribution about the ring, the linear charge density lambda will be Q / (pi a), where we are assigning the variable a to be the radius of the ring. In terms of the charge density, the infinitesimal charge element will be dq = lambda ds = lambda a d(theta).
phi is also introduced now to get ready for consideration of components of dE.
Begin by focusing on the right half of the ring. The infinitesimal contribution dE will point directly away from the charge infinitesimal, along the line connecting it and the point of evaluation.
Please note that the law of cosines was used to represent r2 in terms of a, d, and importantly, theta, our variable of integration.
The symmetry is exploited by considering the conjugate element shown.
The vertical components of dE from one charge infinitesimal will always be balanced by the contribution from its conjugate.
Thus, only the horizontal x-components of the two dE need be integrated. Both halves contribute the same horizontal component, so we need only integrate from 0 to pi and multiply the answer by 2.
Please note that the law of sines was used to represent the sine of phi in terms of a, d, and the sine of theta.