I failed only one portion of the IN exam. Do I have to retake both?

No. You can retake just the section that you still need to pass. Keep in mind you will need to do this retake within one year of the date on your course completion certificate.