Continuity has already been built into these forms. At b, derivative continuity requires −qsin(qb)=−κcos(qb) for even parity and qcos(qb)=−κsin(qb) for odd parity. Thus
Use q/κ=U0/∣E∣−1 to obtain the two printed equations. The right side is positive, so only the corresponding allowed tangent/cotangent branches can describe a bound state; squaring without retaining this sign restriction adds spurious roots.