Hi,
1. He studied very hard, however, he didn't pass the exam.
2. He studied very hard; however, he didn't pass the exam.
3. He studied very hard. However, he didn't pass the exam.
I was wondering if it is alright to use #3 in one sentence and #2 on the other in one essay.
Sure, you can use them both in the same essay if you want to, but why would you want to repeat yourself like that?
In a formal essay, don't use abbreviations, eg say 'he did not' instead of 'he didn't'.
Best wishes, Clive