If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: AP®︎/College Calculus AB>Unit 3

Lesson 7: Selecting procedures for calculating derivatives: multiple rules

# Derivative of eᶜᵒˢˣ⋅cos(eˣ)

By applying both the product and chain rule, we tackle the task of differentiating the function eᶜᵒˢˣ⋅cos(eˣ). This exercise not only provides us with a solution to this complex problem, but also deepens our understanding of these fundamental calculus techniques, reinforcing the importance of these rules in the broader context of calculus. Created by Sal Khan.

## Want to join the conversation?

• The derivative of e^x is equal to e^x. Then, why is the derivative of e^(cos(x)) equal to -sin(x)*(e^(cos(x)) and not to e^(cos(x)) ?
• That's because of the chain rule. In simple terms, when deriving e^A, you will get A'e^A, A' being the derivative of A. Since in the case of e^x, the derivative of x is 1, you simply get e^x. If it was e^2x however, then you would get 2e^2x, due to the derivative of 2x being 2.
• My book is full of functions like √(3x+1)(x-1)^2. My first approach was to use the chain rule on both then apply the product rule. I thought to do that because you clearly have compositions.

However you simply use the product rule to find the solution.

So my question is how do I recognize when to use EITHER the product rule OR the chain rule in function such as this?
• The chain rule deals with a function of a function: d/dx [f (g(x))].

The product rule deals with two separate functions multiplied together. d/dx [f(x) * g(x)].

So you have to see whether your expression is a function of a function, like cos(e^x), or two functions multiplied together, like e^cosx * cos (e^x).
• can we factor out e^cosx from the solution?

so would e^cosx((-cos(e^x)*sinx)-e^x*sin(e^x)) be correct?
• not sure why no one else has answered this, but yes that is correct
(1 vote)
• Why we declare it as "e to the something with respect to something" at . We normally say "x to the squared with respect to x" not "x to the squared with respect to 2". Shouldn't he have said that "e to the something with respect to e"?
• No. "With respect to" identifies the variable of differentiation, not where or how it might appear in the function. To find out, you look at the function definition. Is it f(x) or f(t). At this level of study, you're only dealing with one potential variable of differentiation, but later on you'll deal with more. For example:
f(x,y,z) = 3x²+cos(y) - e^z
When you differentiate, which variable is the variable of differentiation? What are you differentiating with respect to? x, y, or z? With functions like these, you get a different answer depending on what your variable of differentiation is. This should not be confused with differentiation in which one of the variables is defined as a function of the other.

But you don't need to worry about this just yet. For now, you just need to understand that "with respect to" references the variable in the f(of whatever) definition.
• for f(x)=xlnx-nx, x>0, find x in terms of n for f '(x)=0

it says to use the product rule to obtain f ' (x) = x * (1/x) + 1 * lnx-n
I cannot see how to obtain this result with the product rule, and I don't understand how the n fits into the process. Any and all help appreciated!
• Let's start with the original equation, and I'll work through the math step by step.

f(x) = x * ln(x) - nx

We want to take the derivative of this thing with respect to x (aka f ' (x) ), so let's do that:

f ' (x) = d/dx (x * ln(x) - nx)

To solve this derivative, we can first separate out the two terms. Recall that the derivative of one thing minus another thing is just the same as the derivative of the first thing minus the derivative of the second thing. So we can re-write it like this:

f ' (x) = d/dx (x * ln(x)) - d/dx (nx)

Now, "n" is a constant. Remember that the derivative of any constant times x is just that constant. For instance, the derivative of "3x" is just 3, the derivative of "12x" is just 12, and so the derivative of "nx" is just n. So let's just replace "d/dx (nx)" with just "n":

f ' (x) = d/dx (x * ln(x)) - n

Now we just need to solve for the first part, "d/dx (x * ln(x))". We can do this with the product rule:

d/dx (x * ln(x)) = d/dx (x) * ln(x) + x * d/dx (ln(x))

The derivative of x with respect to x is just 1, and the derivative of ln(x) with respect to x is just 1/x. So we can re-write that again as:

1 * ln(x) + x * 1/x

And now, let's not forget to add back that "-n" from before:

f ' (x) = 1 * ln(x) + x * 1/x - n

And that is exactly the same thing that you wrote above (but in a slightly different order). I hope this helps.
• in the "Combining the product and chain rules" exercise i've encountered multiple problems where factors seem to arbitrarily cancel out. For example, the derivative of (x+1)/((e^x)+1) using the quotient rule is (1*((e^x)+1)-(x+1)(e^x))/((e^x)+1)^2. Somehow this simplifies to (1-(xe^x))/((e^x)+1)^2. What I don't understand is how ((e^x)+1)(1) =1 without canceling one of the squares in the denominator.
• ``d/dx((x + 1)/(e^x + 1))(d/dx(x + 1)•(e^x + 1) - (x + 1)•d/dx(e^x + 1))/(e^x + 1)^2(d/dx(x + 1)•(e^x + 1) - (x + 1)•(d/dx(e^x) + d/dx(1)))/(e^x + 1)^2(d/dx(x + 1)•(e^x + 1) - (x + 1)•(d/dx(e^x) + 0))/(e^x + 1)^2(d/dx(x + 1)•(e^x + 1) - (x + 1)•(d/dx(e^x)))/(e^x + 1)^2(d/dx(x + 1)•(e^x + 1) - (x + 1)•(e^x•d/dx(x)))/(e^x + 1)^2(d/dx(x + 1)•(e^x + 1) - (x + 1)•(e^x•dx/dx))/(e^x + 1)^2(d/dx(x + 1)•(e^x + 1) - (x + 1)•e^x)/(e^x + 1)^2((d/dx(x) + d/dx(1))•(e^x + 1) - (x + 1)•e^x)/(e^x + 1)^2((d/dx(x) + 0)•(e^x + 1) - (x + 1)•e^x)/(e^x + 1)^2((d/dx(x))•(e^x + 1) - (x + 1)•e^x)/(e^x + 1)^2((dx/dx)•(e^x + 1) - (x + 1)•e^x)/(e^x + 1)^2((e^x + 1) - (x + 1)•e^x)/(e^x + 1)^2((e^x + 1) - (e^x•x + e^x))/(e^x + 1)^2(e^x + 1 - e^x•x - e^x)/(e^x + 1)^2(1 - e^x•x)/(e^x + 1)^2``
• Does the final result e^x and e^(cos(x)) could be combined together? so it would be e^(cos(2x)) ?
• No. e^(x) * e^(cos x) = e^{ x + cos x]
• At , doesn't (e^x)(e^cos(x)) simplify to e^(cos(x) + x) ?
(1 vote)
• I didn't watch the video, but yes, you can write (e^x)(e^cos(x)) as e^(x + cos(x)).
• Would it be possible to simplify the find expression to:
d/dx = -e^(cos x) [(sin x)(cos e^x) + e^x(sin e^x)]
(1 vote)
• you never put something EQUAL to d/dx. i believe you want to find the derivative of -e^(cos x) [(sin x)(cos e^x) + e^x(sin e^x)] . Isn't it? Yeah its possible. i'll do it for you.

(sin(X))^2cos(e^X)e^cos(X)+sin(X)sin(e^X)e^cos(X)+X-cos(X)cos(e^X)e^cos(X)+e^X sin(e^X)+e^2Xcos(e^X)