How to mathematically show that magnetic field in Helmholtz coil is homogeneous From the title of the question you have probably already figured out what my question is...
How to mathematically show that magnetic field in Helmholtz coil is homogeneous?
I know that magnetic field in Helmholtz coil is homogeneous, of course I am refering to the point in the middle of the two coils (picture below). I even calculated the density of magnetic field inbetween the coils $$\vec{B} = \left(\frac{\mu_0NI}{r}\left(\frac{4}{5}\right)^{3/2}, 0, 0\right)$$
But I don't know how to show that magnetic field is homogenous there from a mathematical point of view.
So I would like to get your advice about the subject, is it even possible? Have I generalised the problem too much?

 A: The field is only approximately homogeneous along a line extending from the centre of the coils. To find out how far the coils must be displaced, you need to set the condition that the curvature of the field at the centre be zero, $\frac{d^2B}{dx^2}=0$. To see why, we can expand the field about the centre point of the two coils, at this location the field magnitude will always be a minimum or a maximum, so the first derivative is always zero. So about this point the field to second order goes something like
$$B(x)\approx B_0+x^2\frac{d^2B}{dx^2}_{x=0},$$
where $B_0=B(0)$, and the x-axis is centred at the mid point between coils. For a homogenous field we require for all $x$, $B(x)=const$. From the expression above, we can see that this condition can be approximately met for a small range of $x$ about the centre point when the curvature $\frac{d^2B}{dx^2}_{x=0}$, vanishes.
A: Along the lines of the answer by @jamie1989 ,
it may be useful is to use https://www.desmos.com/ to PLOT the magnetic field $B(x)$ on the axis, as a function of $x$. (A superposition of two coaxial equal-size loops of radius $R$ carrying currents of equal magnitude and sense, separated by a distance $d$. See the plot )
By symmetry, the field at the center ($x=0$) is a [local] maximum, and the first-derivative is zero at the center. Note how the function behaves as you tune $d$.
At the optimal value of $d$ (which you already have in your diagram), the plot will look very flat around the center at $x=0$. This optimal value occurs when (as @jamie1989 says) when the second-derivative is also zero.
In fact, the third-derivative is zero at $x=0$ (is there a pattern here?)
.... but the fourth-derivative is nonzero.
The derivatives are straightforward, but tedious.
You might need a symbolic algebra tool like Mathematica/WolframAlpha, or
something like  https://www.derivative-calculator.net/ .
Here is $B(x)$ for $d=0$ (dotted), and for $d=R/2$ and $d=2R$.

I'll leave it to you plot $B(x)$ for the optimal-$d$ case.

If you define a function $B(x)$ in Desmos,
you can have it plot the derivative by using $B'(x)$ or $\frac{d}{dx}B(x)$.
For higher derivatives, you can use $B''(x)$ or $\frac{d}{dx}\frac{d}{dx}B(x)$
(Possibly interesting, follow up question... what happens if you reverse the direction of one of the currents?)
(If you want to do better than the Helmholtz coil, try the https://en.wikipedia.org/wiki/Maxwell_coil .)
A: To calculate the magnetic field at any point, you need to do a closed loop integration of the contributions given by each segment of the coils  according to the Biot-Savert Law. To calculate the loop integrals, you will not likely succeed by finding anti-derivatives / indefinite integrals. Rather, you will probably need to transform the definite integrals.
