You can put this solution on YOUR website! If cot(theta) is undefined what does theta equal?
cotx=cosx/sinx
cotx is undefined when sinx=0
sinx=0 at x=0, and x=π
cosx=1 and -1 at x=0, and x=π
so,at x=0, and x=π
cotx=cosx/sinx=1/0 and -1/0 which makes the function undefined