Addition of divisors on trigonal curves