Maximize the difference of the two angles θ {\displaystyle \theta } and ϕ {\displaystyle \phi } with implicit differentiation