For formal English, the second is correct. Your class book probably has a section called indirect questions.
Direct question:
What is the main idea of this article?
Indirect question:
Can you tell me what the main idea of this article is?
If you have a copy of the well-known book English Grammar in Use by Murphy, consult unit 50.