Given the function g(x) = (x^2*cosx - cosx).

We need to differentiate the function g(x).

First we will simplify the function.

==> g(x) = x^2*cosx - cosx

We notice that cosx is a common factor for both terms.

Then we will factor cosx.

==> g(x) = cosx( x^2 - 1)

Now we will use the product rule to find the derivative.

Let g(x) = u*v such that:

u= cosx ==> u' = -sinx

v= x^2 -1 ==> v' = 2x

==> g'(x) = u'*v + u*v'

= -sinx(x^2-1) + cosx*2x

= 2x*cosx - x^2*sinx + sinx

==>** g'(x) = 2x*cosx - x^2*sinx + sinx.**

We have to differentiate g(x) = (x^2*cos x - cos x)

Now g(x) = (x^2*cosx - cosx) = cosx ( x^2 - 1)

Use the product rule for differentiation which states that the derivative of f(x)*g(x) is given by f'(x)*g(x) + f(x)*g'(x)

So g'(x) = cos x * 2x + (-sin x)*(x^2 - 1)

=> g'(x) = 2x*cos x - x^2*sin x + sin x

**Therefore the differential of g(x) = (x^2*cos x - cos x) is g'(x) = 2x*cos x - x^2*sin x + sin x**

We'll differentiate the function with respect to x.

We'll note the function as y = g(x):

dy/dx = d/dx(x^2)*cosx + x^2*d/dx(cosx) - d/dx(cosx)

We can factorize by d/dx(cosx):

dy/dx = 2xcosx + d/dx(cosx)*(x^2 - 1)

We'll write the difference of squares x^2 - 1 as a product:

dy/dx = 2xcosx - sinx*(x - 1)(x+1)

The result of differentiating g(x) is:

**dy/dx = 2xcosx - sinx*(x - 1)(x+1)**