# Derivatives question

1. Nov 8, 2007

### ggcheck

1. The problem statement, all variables and given/known data
hi, I am supposed to differentiate the following:

f(2x+g(x))

I think the problem should be solved as follows:

f(2x+g(x)) * (2x+g(x)) * g(x)

but, my ta said to do the following:

f(2x+g(x)) * (2x+g(x))

please tell me, physicsforums, which is the correct way?

why?

2. Nov 8, 2007

### Avodyne

Suppose you had f(h(x)). What would you say the derivative (with respect to x) is?

OK, now let h(x)=2x+g(x).

3. Nov 8, 2007

### ggcheck

"Suppose you had f(h(x)). What would you say the derivative (with respect to x) is?"

"OK, now let h(x)=2x+g(x)."

I am confused, but luckily I know where I am confused so I guess there is hope.

f(h(x)) where h(x) = 2x+g(x)

wouldn't we have: df/dh * dh/dg * dg/dx ???

4. Nov 8, 2007

### Avodyne

Let me try that again. Consider f(x^2). What is the derivative with respect to x?

5. Nov 8, 2007

### ggcheck

f * (x^2)
?

6. Nov 9, 2007

### Avodyne

OK, good. A clearer way to write this is f'(x^2)*(x^2)' And of course (x^2)'=2x.

Now consider a more general function h(x) as the argument of f: f(h(x)). The derivative of this with respect to x is f'(h(x))*h'(x).

Now, h(x) can be *any* function. It could be, for example, x^3. Or it could be x^3 + 2x. It doesn't matter what it is; we ALWAYS apply the formula f'(h(x))*h'(x).

So, if h(x)=g(x)+2x, we STILL apply the SAME formula. We don't multiply again by g'(x).

7. Nov 9, 2007

### ggcheck

yeah, but I thought because it has another function inside of it (g(x)), we apply the chain rule again. sort of like we do with sin(cos(sinx)))

8. Nov 9, 2007

### Avodyne

No, because g(x) is not inside of g(x)+2; that would mean something like f(g(g(x))+2x), with an extra "nesting".

9. Nov 9, 2007

### ggcheck

this "nesting" is where I am confused? how exactly can I determine if there is a "nesting"?

10. Nov 9, 2007

### HallsofIvy

Staff Emeritus
This is an example of "nesting". The second sin(x) is "inside" (an argument of) the function cosine (and the whole assembly is a function of sine again).
[sin(cos(sin(x)))]' = cos(cos(sin(x)))[-sin(sin(x))][cos(x)]

If instead, you had sin(cos(x)+ sin(x)), the second sine is NOT "nested"- it is not an argument of the function cosine. The sum of the two functions is an argument of the sine function.
[sin(cos(x)+ sin(x))]'= cos(cos(x)+ sin(x))[-sin(x)+ cos(x)]

11. Nov 9, 2007

### ggcheck

but in : f(2x+g(x))

since g(x) is inside the argument of f(x) isn't g(x) nesting?

12. Nov 9, 2007

### HallsofIvy

Staff Emeritus
It is not just g(x) but the whole 2x+g(x) that is inside f- you need to use the chain rule once, not twice: df(2x+g(x))/dx = (df/du)(du/dx) where u= 2x+ g(x). that is df/dx=f'(2x+g(x))(2+ g'(x)), exactly the same as the f(2x+g(x)) * (2x+g(x)) your TA said- as long as you understand the " ' " to mean differentiation with respect to "the" variable- 2x+g(x) in f' and x in (2x+g(x))'. The point is that you have already used the chain rule in muliplying by (2x+ g(x))"- there is no reason to multiply by g'(x) again.

13. Nov 9, 2007

### ggcheck

so we would only need to use the chain rule a second time if there was something "nesting" inside of g(x)?

14. Nov 9, 2007

### Avodyne

Yes, if the argument of g(x) was something other than x, then we would need the chain rule a second time.

15. Nov 9, 2007

### ggcheck

so it doesn't matter what g(x) is... it only matters what is in the argument of g(x)

g(x) could = (x^3+(x-1)^1/2 - 35x^14)^5/3 ... etc...

as long as only x is in the argument?

16. Nov 9, 2007

### Avodyne

Yes!

17. Nov 9, 2007

### ggcheck

Ok, so to sum things up.... if we have:

f(2x+g(x))

and g(x)=(x^3+(x-1)^1/2 - 35x^14)^5/3 (copied from the last hypothetical)

then f(2x+g(x))= f(2x+g(x)) * (2x+g(x)) =
f(2x+g(x)) * 5/3(x^3 +(x-1)1/2 - 35x^14)^2/3

18. Nov 10, 2007

### Avodyne

The first line is correct. But then you did not compute (2x+g(x))' correctly.

(2x+g(x))' = 2 + g'(x), and

g(x) = h(x)^5/3, where h(x) = x^3+..., so

g'(x) = 5/3 h(x)^2/3 * h'(x)