For both problems, you want to use the product rule and the chain rule.

The first one looks like .

So . (That was applying the product rule)

Now apply the chain rule to the things left to differentiate inside the square braces:

Get

.

And you can simplify that to make it prettier. That should be the answer, barring a typo error; it can be troublesome to do math when you're looking at the problem through LaTeX notation.

The exact same techniques apply to the second problem which has the same basic form. Use the product rule, followed by the chain rule.