The ways to differentiate a function depend on the function itself. If there is only one x value in the function you can differentiate as normal (hard to explain on a computer), yet if the function contains more than one x value is a separate place, you will need to use another approach such as the chain, product or quotient rule