sage: ex=atan(sin(1/5*pi)/cos(1/5*pi, hold=True))

The problem is that cos(pi/5) gets immediately simplified to (sqrt(5)+1)/4 in Sage before Maxima can be called. This can be prevented by saying cos(pi/5,hold=True).