I saw this failing documentation test, for some reason the returned value was in a different (wrong) order.

I do not know how my changes might have corrected the order of the terms in "cot(z) + csc(z)" expression