I'm trying to derive the formula for the electric field a height $h$ above the center of a uniformly charged square sheet with sides $2a$.
To do so I'm using the formula for the electric field above the center of a line segment with length $2L$ and uniform charge density:
$$E = \frac{2k_e\lambda L}{h\sqrt{h^2+L^2}}$$
Then using the fact that $\lambda(2L) = Q$, I get
$$E = \frac{k_eQ}{h\sqrt{h^2+L^2}}$$
Then I can cut the square sheet into line segments with differential charge $dq = \sigma dA$ and differential area $dA = 2adx$. I just have to take into account that I only need the vertical component of the electric fields and integrate:
$$\begin{align}E &= k_e(\sigma 2a)\int_{-a}^a \frac{dx}{\sqrt{h^2+x^2}\sqrt{h^2+x^2+a^2}}\cos(\theta) \\ &= 4a\sigma k_e\int_0^a \frac{dx}{\sqrt{h^2+x^2}\sqrt{h^2+x^2+a^2}}\frac{h}{\sqrt{h^2+x^2}} \\ &= 4a\sigma hk_e\int_0^a \frac{dx}{(h^2+x^2)\sqrt{h^2+x^2+a^2}}\end{align}$$
I can't figure out any way to integrate this, but Mathematica is giving me
$$E = 4\sigma k_e\arctan\left(\frac{a^2}{h\sqrt{h^2+a^2+a^2}}\right)$$
However I know the answer is supposed to be
$$E = 2\sigma k_e\left[4\arctan\left(\sqrt{1+a^2/(2h^2)}\right)-\pi\right]$$
I can see these are not just the same answer in different forms by plugging in 1s for all the constants and evaluating. Where am I going wrong?
Best Answer
Your answer is flawless: there is nothing the matter with it. Both formulae are equivalent, and can be shown to be so with this identity:
$tan^{-1}(\frac{2u}{u^2-1})=2tan^{-1}(\frac{1}{u}+/-n\pi)$
Substitute $u^2=1+\frac{2a^2}{z^2}$ and you'll find they are equal.