First we start off by seeing that we are multiplying together two functions both containing x, so we want to apply the product rule. As we know the product rule is (f(x)g(x))'=f(x)g'(x)+f'(x)g(x) so we can assign f(x) to x^2 and g(x) to cos 3x. We can differentiate x^2 using the power rule, finding our new factor as 12 = 2, and decreasing the power by 1, giving us f'(x)=2x. We can then also differentiate our g(x), cos3x. For this we can see we need to use the chain rule. We can set u=3x and hence g(x) can be simplified to cos(u) which we know how to differentiate. We differentiate u, giving us u'=3 and differentiate cos(u), giving us -sin(u). We then multiply together (dy/du) and (du/dx), so -sin(u) * 3 = -3sin(u). We can then substitute 3x back in for u as u=3x, giving us g'(x)=-3sin(3x). Now that we have f'(x) and g'(x) we can apply the product rule, giving us the answer as (x^2)-3sin(3x) + 2x * cos(3x), so -3(x^2)sin(3x) + 2xcos(3x).