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 .)