In order to decrease the fluid drag on an underwater robot manipulator, an optimal trajectory method based on the variational method is presented. By introducing the adjoint variables, which are Lagrange multipliers, we formulate a Lagrange function under certain constraints related to the target angle, target angular velocity, and dynamic equation of the robot manipulator. The state equation (the partial differentiation of the Lagrange function with respect to the state variables), adjoint equation (the partial differentiation of the Lagrange function with respect to the adjoint variables), and sensitivity equation (the partial differentiation of the Lagrange function with respect to torques) can be derived from the stationary conditions of the Lagrange function. Using the state equation, we can calculate the state variables (angles, angular velocities, and angular acceleration) at every time step in the forward time direction. These state variables are stored as data at every time step. Next, by using the adjoint equation, we can calculate the adjoint variables by using these state variables at every time step in the backward time direction. These adjoint variables are stored as data at every time step. Third, the sensitivity equation is calculated by using both the state variables and the adjoint variables. Finally, the optimal trajectory of the manipulator is obtained using the sensitivities. The proposed method is applied to the problem of two-link manipulators. It can obtain the optimal drag reduction trajectory of the manipulator under the constraints mentioned above.