This was a physics example regarding electric field, but I need some help in the calculation part.
Positive charge $Q$ is uniformly distributed along the $y-axis$ between $y=-a$ and $y=+a$. Find the electric field $P$ on the $x-axis$ at a distance $x$ from the origin
So the electric field is generated by a rod, which is broke into infinitesimal segments.
Rod below
| <== $dy$
|
| -------------$x$------------ $P$
|
|
Each segment is called $dy$
$x$ is the distance from $P$ to the rod
$2a$ is the length of rod
$Q$ is total charge, $Q/2a$ is the linear charge density
After a series of steps, the textbook reached the following step, for the $x$ component of the electric field: $$ E_{x} = \frac{1}{4\pi \epsilon_{0}} \frac{Q}{2a} \int_{-a}^{a} \frac{x{\,}dy}{(x^2+y^2)^{3/2}} $$
the detail of evaluation was omitted in the textbook, but it's evaluated to $$ E_{x} = \frac{Q}{4\pi \epsilon_{0}} \frac{1}{x \sqrt {x^2+a^2}} $$
I spent a good deal of time trying to evaluate this integral myself using substitution but all met dead ends. I need some guidance on this.
What you need is essentially the followig indefinite integral: \begin{align} \int \frac{1}{(x^2+y^2)^{3/2}}\,dy &=\int \frac{\cos u}{x^2}du& (y=x\tan(u),\ dy=x\sec^2(u)du)\\ &=\frac{\sin(u)}{x^2}+C\\ &=\frac{\sin(\tan^{-1}\frac{y}{x})}{x^2}+C\\ &=\frac{y}{x^2\sqrt{x^2+y^2}}+C \end{align}
It follows that \begin{align} \int_{-a}^a\frac{x}{(x^2+y^2)^{3/2}}dy &=2x\int_{0}^a\frac{1}{(x^2+y^2)^{3/2}}dy\\ &=2x\cdot \frac{y}{x^2\sqrt{x^2+y^2}}\big|_{y=0}^{y=a}\\ &=\frac{2a}{x\sqrt{x^2+a^2}} \end{align}