sorry im dumb... but could u pls explain how this works? i get the derivative of cos = -sin, but where do I get the pi out the front from? and then how can i make that substitution (im confused)
Sure, no problem!
So, basically it's an implicit chain rule. You can explicitly see this by making a subtle substitution here: \( u = \pi x \).
As long as you understand where the chain rule comes from, these types of functions should then be quite simple to differentiate. That is: \( \frac{d}{dx}f(g(x)) = f'(g(x)) \cdot g'(x)\). In this case, our "outer" function, \( f(x) \), is \( \cos x \) and our "inner" function, \( g(x) \), is \( \pi x \).
and then how does -1/pi end up out the front??
sorry for all the questions
This one requires a bit more clever thinking! Notice that \( \frac{d}{dx}(\cos x) = -\sin x \). So if we had something like this: \( \int -\cos x \sin x\,dx \), then what we can do is a little substitution. That is, \( u = \cos x \), because when we differentiate, we find the following:
\[ u = \cos x \Rightarrow \frac{du}{dx} = -\sin x \\ \therefore du = -\sin x\,dx \]
Comparing our integral, we see that:
\[ \begin{align*} \int -\cos x \sin x\,dx &= \int \underbrace{\cos x}_{u} \cdot \underbrace{(-\sin x\,dx)}_{du} \\ &= \int u\,du \end{align*}\]
The same works with our integral of choice. Except it's a little bit more work. When we use the substitution \( u = \cos(\pi x) \), we find that:
\[ \frac{du}{dx} = -\pi \sin(\pi x) \Rightarrow du = -\pi \sin(\pi x)\,dx \].
Comparing our integral, we see that:
\[ \begin{align*} \int \cos^k(\pi x) \cdot (\sin(\pi x)\,dx &= \int \underbrace{\cos^k(\pi x)}_{u^k} \cdot (\sin(\pi x)\,dx)\end{align*} \]
In this case, our "\( du \)" is not exactly the same as the one we have in our integral. So, in this case, we need to
manipulate our "\( du \)". Our integral is missing a \( -\pi \).
\[ \begin{align*} \int \cos^k(\pi x) \cdot (\sin(\pi x)\,dx &= \int \frac{-\pi \cdot \cos^k(\pi x) \cdot (\sin(\pi x)}{-\pi}\,dx \\ &= \int \frac{\cos^k(\pi x) \cdot (-\pi \sin(\pi x))}{-\pi}\,dx \\ &= -\frac{1}{\pi} \int \underbrace{\cos^k(\pi x)}_{u^k} \cdot \underbrace{(-\pi \sin(\pi x))\,dx}_{du} \\ &= -\frac{1}{\pi}\int u^k\,du \end{align*}\]