The stairs are difficult for the weak elderly. This study aims to reduce the burden on elderly people while using an assistive device to go upstairs. A walking trajectory optimization method that reduces the torque required by the hip and knee joints of the user was proposed. The device tracks the predefined walking trajectories through the impedance control to teach the user to walk. On the premise of not changing the predefined trajectory as much as possible, reducing the force required for walking is the goal of the optimization. The required torque of the user was derived through the established human-device model. By sequential quadratic programming (SQP) method, the optimized stair ascent trajectory that reduces the user’s torque was generated. To verify that the optimized trajectory can reduce the needed force of the user, we compared the electromyography (EMG) of different muscle groups when subjects were assisted by the normal and optimized trajectories. The results showed that using the optimized trajectory, the proportions of muscle used were decreased successfully. This method can increase the exercise time of the user successfully.