Solution (source code)

= Solution

Put $q(x)=4\pi\alpha(x)/c$. Because every component depends only on $x$, the solenoidal constraint gives $B_x'=0$, while the force-free equation gives
$$
0=qB_x,\qquad
-B_z'=qB_y,\qquad
B_y'=qB_z.
$$
For a general nonzero, nonconstant $q$, $B_x=0$. Eliminating $B_y=-B_z'/q$ gives the closed equation
$$
\boxed{B_z''-\frac{q'}qB_z'+q^2B_z=0},
$$
or equivalently $(B_z'/q)'+qB_z=0$. Since $\nabla\alpha=\alpha'(x)\mathbf e_x$ and $B_x=0$, the constraint $\mathbf B\cdot\nabla\alpha=0$ is automatically satisfied.