Now, any curve that lies on a sphere has positive curvature $\kappa$, but it need not have nonvanishing torsion $\tau$, of course. Thus, the above criterion does not make sense for all nondegenerate curves, i.e., space curves for which $\kappa$ is positive (which are the curves for which the classical Frenet frame is well-defined). The following argument shows that one cannot hope to have a necessary and sufficient condition expressed in terms of local conditions for spherical curves that works for all nondegenerate space curves: Consider two distinct spheres $S_1$ and $S_2$ that intersect along a circle $C$. It is easy to construct a smooth curve $x(s)$ with positive curvature $\kappa$ that starts out on $S_1$ (but not on $S_2$), runs along $C$ for some interval, and then continues on $S_2$ (after leaving $S_1$). This curve is locally spherical, but not globally spherical, so no local condition can be necessary and sufficient for all nondegenerate space curves.
Meanwhile, one can get an expression that makes sense and works for all nondegenerate curves by considering the identity $$ \frac{d\ }{ds}\left(\frac{(\kappa')^2 + \kappa^2\tau^2}{\kappa^4\tau^2}\right) = \frac{2\kappa'\bigl((\kappa\kappa''-2\kappa'^2-\kappa^2\tau^2)\,\tau - \kappa\kappa'\tau'\bigr)}{\kappa^5\tau^3}, $$$$ \frac{d\ }{ds}\left(\frac{(\kappa')^2 + \kappa^2\tau^2}{\kappa^4\tau^2}\right) = \frac{2\kappa'\bigl((\kappa\kappa''-2\kappa'^2-\kappa^2\tau^2)\,\tau - \kappa\kappa'\tau'\bigr)}{\kappa^5\tau^3}. $$ which shows thatIn fact, any nondegenerate space curve that satisfies the nondegeneracy condition that $\kappa$, $\kappa'$, and $\tau$$\kappa\tau$ be nonvanishing while $$ P(\kappa,\kappa',\kappa'',\tau,\tau') = (\kappa\kappa''-2\kappa'^2-\kappa^2\tau^2)\,\tau - \kappa\kappa'\tau' = 0 $$ must necessarily lie on a sphere (of some unspecifiedof radius) $r$ where $r^2 =\bigl((\kappa')^2 + \kappa^2\tau^2\bigr)/(\kappa^4\tau^2)$ . This is, in some sense, the correct statement of the classical result. (Proof: If the above equation holds and $\kappa\tau$ is nonvanishing, then the corresponding space curve $X:(a,b)\to\mathbb{R}^3$ satisfies the condition that $\bigl((\kappa')^2 + \kappa^2\tau^2\bigr)/(\kappa^4\tau^2)$ be constant. Moreover, if $T$, $N$, and $B$ are the Frenet frame of $X$, so that $X' = T$, $T' = \kappa N$, $N' = -\kappa T+\tau B$ and $B' = -\tau N$, where the prime denotes differentiation with respect to arclength, then the curve $Y = X + (1/\kappa)N - (\kappa'/(\kappa^2\tau)) B$ satisfies $Y' = 0$.)