# Chain Rule Confusion

Below i have a function that i need to use the chain rule on. My friend showed me his answer which was correct which was $-8x^7\sin(a^8+x^8)$.

$$y = \cos(a^8 + x^8)$$

I am really confused as how he got that. I know that in the chain rule you bring whats outside to the front. So why is $a^8$ not in this solution?

• What is the derivative of a constant?
– M.B.
Commented Jul 1, 2012 at 22:19
• Use \cos and \sin.
– Did
Commented Jul 1, 2012 at 22:32
• SO a is a constant? How do i know this though? Commented Jul 2, 2012 at 1:13
• It's really something you have to pick up from context (i.e. the bit of the question which isn't the equation). If you're trying to work out $dy/dx$, anything which doesn't involve either $y$ or $x$ is a constant. If you're trying to work out $dz/dt$, then something involving $x$ would be a constant. Really this is all an unfortunate consequence of sloppy notation. Commented Jul 2, 2012 at 2:17

You’re trying to treat the chain rule as a mechanical manipulation of symbols instead of understanding what it actually says. It says that when you differentiate a composite function, say $g\big(f(x)\big)$, you first take the derivative of $g$ as if $f(x)$ were the independent variable, and then you multiply by $f\,'(x)$.
Here you have $h(x)=\cos(a^8+x^8)$, and you want $h'(x)$. First pretend that what’s inside the cosine is a single variable; call it $u$, if you like so that $u=a^8+x^8$ and $h(x)=\cos u$. Now differentiate with respect to $u$ to get $-\sin u$. But you weren’t really differentiating with respect to $u$: you were differentiating with respect to $x$. The chain rule says that in order to compensate for this distinction, you must now multiply by $\frac{du}{dx}$. Since $a^8$ is a constant, its derivative (with respect to anything!) is $0$, and therefore $\frac{du}{dx}=8x^7$. The chain rule now tells you that $$h'(x)=\Big(-\sin(a^8+x^8)\Big)\Big(8x^7\Big)=-8x^7\sin(a^8+x^8)\;.$$
• Question though, how do i know $a^8$ is a constant? Or just memorize that a in a derivative is a constant? Commented Jul 2, 2012 at 1:14
• No, a is a constant because the expression is derived regarding x. If it were $\frac{du}{da} then x were the constant, and a the variable. – vsz Commented Jul 2, 2012 at 6:07 • @vsz: Nowhere in the problem as relayed by the OP does it specify that the differentiation is with respect to$x$; we can only infer that from convention (and the friend’s correct answer). Moreover, the fact that the differentiation is w.r.t.$x$is not sufficient to rule out the possibility that$a$is itself some function of$x$, and that the correct is actually$-8(a^7a'+x^7)\sin(a^8+x^8)$. Again, only our knowledge of convention and of what’s likely to appear in a problem at this level lets us answer correctly. Commented Jul 2, 2012 at 16:55 Note that$y$is a function of$x$and$a$is just a constant. To understand the procedure, let us call$x^8 + a^8$as a function$f(x)$. We then have $$y = \cos(f(x))$$ Hence, by chain rule we get that $$\dfrac{dy}{dx} = \dfrac{dy}{df} \times \dfrac{df}{dx}$$ Now$\dfrac{dy}{df} = -\sin(f(x))$and$\dfrac{df(x)}{dx} = \dfrac{d(x^8 + a^8)}{dx} = \dfrac{d(x^8)}{dx} + \dfrac{d(a^8)}{dx}$. Now recall that $$\dfrac{d (x^n)}{dx} = n x^{n-1} \text{ and } \dfrac{d (\text{ constant })}{dx} = 0$$ Hence, we get that$\dfrac{d(x^8)}{dx} + \dfrac{d(a^8)}{dx} = 8 x^7 + 0 = 8x^7$. Hence, we get that $$\dfrac{dy}{dx} = \dfrac{dy}{df} \times \dfrac{df}{dx} = - \sin(f(x)) \times \left(8x^7 \right) = - 8x^7 \sin \left( x^8+a^8 \right)$$ HINT What is the derivative of$a^8+x^8$? It doesn't have any$a$term either. The fact that$a$is a constant is one of those things you have to infer from context. Typically, in single variable calculus, one uses letters towards the end of the alphabet are all dependent on one another (typically the relationship is they are all functions of$x$,$t$, or$z$), and other letters without prior meaning (e.g.$f$and$g$) as constants. One can use$a$as a variable functionally dependent on$x$. If$a$is used that way in the stated problem, then you would have another term in the answer that includes a factor of$\frac{da}{dx}\$.