It appears that you have ignored all minus signs and just added all terms together. When you add functions, you need to add positive and negative terms, or add two negative terms, with the same sign rules you have been using.