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?
 A: 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)\;.$$
A: 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)$$
A: HINT
What is the derivative of $a^8+x^8$? It doesn't have any $a$ term either.
A: 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}$.
