Every things is alright now, but the reference answer is n*pi+[(-1)^n-1]*pi/4, which is different from mine, could anyone tell me how to combine that 2 solutions I found together?

Again, a little problem, I found that the second general solution is strange because it make sec 5x + csc 2x undefined in some cases of n.