This paper presents efficient geometric algorithms to analytically evaluate the first- and second-order information of humanoid dynamics within a trajectory optimization scheme. In particular, the exact Hessians of the robot’s center of mass and the centroidal momentum are provided to the optimization solver for synthesizing dynamically feasible humanoid motions. The transcription method applies direct collocation to parametrize the humanoid’s configuration space with B-Spline curves. The proposed algorithms avoid the computation of redundant information by exploiting the commutativity of the Kronecker product and the symmetry in second-order derivatives. We validate the effectiveness of the optimization strategy with the humanoid robot models Nao and Atlas. (The C++ code can be found in github.com/AlvaroPaz/BSplinesTrajOpt.)