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.

# Derivative of sin(ln(x²))

AP.CALC:
FUN‑3 (EU)
Sal differentiates sin(ln(x²)) by applying the chain rule twice. Created by Sal Khan.

## Want to join the conversation?

• At , could you also write g'(h(x)) as (x^2)^-1, which would by the power rule would turn out to be -(x^2)^-2 . Am I wrong?
• Close, but wrong.

1). You're solving a different problem. You're trying to get the derivative of 1/(x^2), which as you stated can be rewritten as (x^2)^-1. But Sal was getting the derivative of ln(x^2).... but to continue on with (x^2)^-1, and why the derivative of that isn't -(x^2)^-2...

g(x) = x^-1, h(x)=x^2 derivative of g(h(x)) = g'(h(x))*h'(x) by the Chain Rule
you forgot to multiply by h'(x).
So you got half of that correct, g'(x) = -1(x)^-2, by the Power Rule.
and g'(h(x)) = -1(x^2)^-2
h'(x) = 2x, also by the power rule.
By the Chain Rule the derivative is of (x^2)^-1 is -1((x^2)^-2)*2x, you forgot the 2x.

2). The inner composite sal was solving is ln(x^2), not (x^2)^-1.
g(x) = ln(x), g'(x) = 1/x
h(x) = x^2, by the power rule, h'(x) = 2x
g'(h(x)) = 1/x^2, or (x^2)^-1
g'(h(x))*h'(x) = (1/(x^2))*2x = 2/x

And that's just the derivative of the inner composite.

Hope that helped.
• Can the chain rule be applied backward to anti derivatives?
• Indeed it can. This technique is often referred to as "u-substitution". For example, we know that the derivative of sin^2(x) is 2*sinx*cosx. Now, if I want to take the antiderivative of that, we have
∫ 2*sinx*cosx dx I can make the substitution u=sinx and du/dx=cosx or, equivalently, du=cosx*dx
∫2*u*du = u^2 + c = (sinx)^2 + c
• what is the composite of a function?
• Hello!

Composition of functions basically means that you replace the placeholder x in f(x) with a function.

`f(x) = x^2`, could be rewritten as:
`f("our number") = "our number"^2`.

Similarly, we could replace the placeholder `x` with a "proper" function. Let me define:
`g(x) = 2x + 2`.
If I were to replace the placeholder `x` in `f(x)` with `g(x)`, I would get:
`f(g(x)) = (2x + 2)^2`.

This is basically the same principle as:
`f(5) = 5^2`.
We replaced our placeholder x with 5, and that number becomes squared, since
`f(x) = x^2`.

Composition of functions is when you replace the placeholder in `f(x)` with another function `g(x)`.

Finally, `f(g(x))` can be written as `f o g(x)`, which can be interpreted as applying the function g to the function f.

Hope I could help!

// Kristian
• Can anyone who is proficient in this subject clarify this problem for me? Say, we have `d/dx f[g(h(x))]` as the example in this video. Is it equivalent to `d/d[g(h(x))] f[g(h(x))] * d/d(h(x)) g(h(x)) * d/dx h(x)`?
• Not quite. It should be:
`d/dx(f(g(h(x))) = f'(g(h(x))) * g'(h(x)) * h'(x)` , where I'm using the "prime" notation for the derivative instead of d/dx. One way to think about it is that the Chain Rule "chains" together the derivatives of whatever functions are being composed. So if you have the composition of three functions f, g, and h, you should expect your derivative for `f(g(h(x)))` to be the product of three derivatives (as shown above). Hope that helps!
• Is there a recursive formula that can give us an arbitrary or even infinite number of functions to be chained together to be derived? In other words, is there a chain rule of _k_ or infinite composition?
• Sure, and this is how a computer algebra system handles it. Let's start a little simpler: Say you've got a simple addition, a + b + c + d. And if you only knew how to multiple two numbers, you could approach it as a + (b + (c + d))). That's called "reduction," where you take many operations and break them into parts.

Here's where it gets tricky: f(g(x)) can be viewed as f • g, and f(g(h(x))) is like f • (g • h), where the dot • is called "function application". We take away the x’s because we're dealing with the functions themselves as values.

That makes it a bit more obvious that the chain rule is an operation on that application, it's just saying, (f • g)’ = (f’ • g) ⨉ g’ so we're just moving some symbols around.

And then if I have (f • (g • (h • i)))’, you can see how you'd just churn through it from the outside in:

q = (g • (h • i))
(f • (g • (h • i)))’ = f’ • (g • (h • i))) ⨉ (g • (h • i))’
(g • (h • i))’ = g’ • (h • i) ⨉ (h • i)’
(h • i)’ = h’ • i ⨉ i’

And then substitute back in:
(g • (h • i))’ = g’ • (h • i) ⨉ (h’ • i ⨉ i’)
(f • (g • (h • i)))’ = f’ • (g • (h • i))) ⨉ g’ • (h • i) ⨉ h’ • i ⨉ i’

Anyway, if you had an arbitrary array of functions k[1], k[2], k[3]..., it looks like your rule would be:

(k[1] • k[2] • k[3] … k[n])’ = ∏ k[i]’ • k[i-1] • k[i-2] … k[1] where i goes from 2 to n

d/dx (k[1](k[2](k[3](...k[n](x)…)))) = ∏ k[i]’(k[i-1](k[i-2](…k[1](x)…))) where i goes from 2 to n
• i have a doubt.. can we take the derivative of ln (2x) with chain rule? or its just 1/2x.. how do you build the composite function??
(1 vote)
• the derivative is `1/(2x) * 2` which simplifies to `1/x`.
`1/(2x)` is the outer derivative, and here it is important to leave the inner function `2x` unchanged!
`2` is the derivative of the inner function `2x`.
• In the exercise that follows, how is that

2•csc(x)•sec(x) + 2x•-csc(x)•cot(x)•sec(x) + 2x•csc(x)•sec(x)•tan(x)

is becoming

2•csc(x)•sec(x) - 2x•csc^2(x) + 2x•sec^2(x)

?

I mean, what happened to cot(x) and tan(x)?
• I found out what happened. If anyone is lost, it comes from:

sin(x) = cos(x)tan(x)
cos(x) = sin(x)cot(x)
tan(x) = sec(x)sin(x)
csc(x) = cot(x)sec(x) <--------
sec(x) = tan(x)csc(x) <--------
cot(x) = csc(x)cos(x)
• I'm pretty confused because every website I've read has said that the derivative of ln(x^2) is actually 2x/x^2 (which is what I got too) but Sal wrote that it was 1/x^2.. am I just wrong? or did Sal forget the 2x?
• Actually, Sal did write the 2x later. He wrote it as (1/x^2) * 2x instead of 2x/x^2. Those 2 expressions are equivalent, so don't worry about it. Hope this clarifies it a little.