Yes that is the right setup. You need to fully understand the previous question on the same topic you asked before moving on. You haven't replied to the latest posts there. If you follow the work done in that thread you can see the method that you're asking about. If you still don't get it, ask a question and someone will explain. Then you should be able to do all of these types of problems.