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

1 Answer
May 29, 2016

Answer:

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))#

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

#d/dx f(x)=cosx+2sinx-3e^xcosx-e^xsinx- xsinx+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)#. The product rule is

#d/dx f(x)=(d/dx g(x))*h(x)+g(x)*(d/dx h(x))# .

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

We have

#d/dx f(x)=(d/dx (x-e^x))(cosx+2sinx)+ (x-e^x)(d/dx(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))# .

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))# .

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

#d/dx x^n= n*x^{n-1}# # # # # # # #d/dx e^x=e^x#

#d/dx sin x= cos x# # # # # # # #d/dx cos x= - sin x# .

Now we have

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

#d/dx f(x)=(1-e^x)(cosx+2sinx)+ (x-e^x)(-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)#

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

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