How do you differentiate f(x)=(x-e^x)(cosx+2sinx)f(x)=(xex)(cosx+2sinx) using the product rule?

1 Answer
May 29, 2016

First you use production rule to get

d/dx f(x)=(d/dx (x-e^x))(cosx+2sinx)+ (x-e^x)(d/dx(cosx+2sinx))ddxf(x)=(ddx(xex))(cosx+2sinx)+(xex)(ddx(cosx+2sinx))

Then use the linearity of the derivative and function derivative definitions to get

d/dx f(x)=cosx+2sinx-3e^xcosx-e^xsinx- xsinx+2xcosxddxf(x)=cosx+2sinx3excosxexsinxxsinx+2xcosx

Explanation:

Product rule involves taking the derivative of function which are multiples of two (or more) functions, in the form f(x)=g(x)*h(x)f(x)=g(x)h(x). The product rule is

d/dx f(x)=(d/dx g(x))*h(x)+g(x)*(d/dx h(x))ddxf(x)=(ddxg(x))h(x)+g(x)(ddxh(x)) .

Applying it to our function,
f(x)=(x-e^x)(cosx+2sinx)f(x)=(xex)(cosx+2sinx)

We have

d/dx f(x)=(d/dx (x-e^x))(cosx+2sinx)+ (x-e^x)(d/dx(cosx+2sinx))ddxf(x)=(ddx(xex))(cosx+2sinx)+(xex)(ddx(cosx+2sinx)) .

Additionally we need to use the linearity of the derivation, that

d/dx(a*f(x)+b*g(x))=a*(d/dx f(x))+b*(d/dx g(x))ddx(af(x)+bg(x))=a(ddxf(x))+b(ddxg(x)) .

Applying this we have

d/dx f(x)=(d/dx (x)-d/dx (e^x))(cosx+2sinx)+ (x-e^x)(d/dx(cosx)+2*d/dx (sinx))ddxf(x)=(ddx(x)ddx(ex))(cosx+2sinx)+(xex)(ddx(cosx)+2ddx(sinx)) .

We need to do the individual derivatives of these functions, we use

d/dx x^n= n*x^{n-1}ddxxn=nxn1 d/dx e^x=e^xddxex=ex

d/dx sin x= cos xddxsinx=cosx d/dx cos x= - sin xddxcosx=sinx .

Now we have

d/dx f(x)=(1*x^0-e^x)(cosx+2sinx)+ (x-e^x)(-sinx+2cosx)ddxf(x)=(1x0ex)(cosx+2sinx)+(xex)(sinx+2cosx) .

d/dx f(x)=(1-e^x)(cosx+2sinx)+ (x-e^x)(-sinx+2cosx)ddxf(x)=(1ex)(cosx+2sinx)+(xex)(sinx+2cosx)

At this point we just neaten a bit

d/dx f(x)=(cosx+2sinx)-e^x(cosx+2sinx)+ x(-sinx+2*cosx)+e^x(sinx-2cosx)ddxf(x)=(cosx+2sinx)ex(cosx+2sinx)+x(sinx+2cosx)+ex(sinx2cosx)

d/dx f(x)=cosx+2sinx-e^xcosx-2 e^xsinx- xsinx+2xcosx+e^x sinx-2e^xcosxddxf(x)=cosx+2sinxexcosx2exsinxxsinx+2xcosx+exsinx2excosx

d/dx f(x)=cosx+2sinx-3e^xcosx-e^xsinx- xsinx+2xcosxddxf(x)=cosx+2sinx3excosxexsinxxsinx+2xcosx