You could just bribe the troll, although you'll lose a treasure.
Butt, there is another way to solve the puzzle.
Have you found the carrot growing in the garden?
Have you found the goat behind the fence?
Show the carrot to the goat, and lead him to the troll, and stand back!