When evaluating $ \int \cos^3(x)dx$, I've only seen that the first step is to recognize that $\cos^3(x)=\cos(x)(\cos^2(x))\Rightarrow \cos(x)(1-\sin^2(x))$, followed by distributing the $\cos(x)$ and then integrating as usual, giving $\sin(x)-\frac{\sin^3(x)}{3}+C$ as the indefinite integral.
My question is if we can use the derivative of $\cos^4(x)$ to evaluate the integral like this: $$\frac{d}{dx}[\cos^4(x)]=-4\cos^3(x)\sin(x)$$
With this, we set up $$\int\cos^3(x)dx=\frac{-4\sin(x)}{-4\sin(x)}\int\cos^3(x)dx$$
And then multiply the $-4\sin(x)$ into the integrand to use the anti-derivative: $$=\frac{1}{-4\sin(x)}\int-4\cos^3(x)\sin(x)dx$$ $$=\frac{1}{-4\sin(x)}(\cos^4(x))+C$$
Which will ultimately give us the indefinite integral as $$\int\cos^3(x)dx=\frac{-\cos^4(x)}{4\sin(x)}+C$$
Is this a legitimate approach? Thank you for your time!
$$\frac{d}{dx}\left(\cos^4(x)\right)=-4\cos^3(x)\sin(x)$$
implies that
$$\int -4\cos^3(x)\sin(x)\,dx = \cos^4(x)+C.$$ While it is true that you can write $$\int\cos^3(x)\,dx=\frac{-4\sin(x)}{-4\sin(x)}\int\cos^3(x)\,dx,$$
it is incorrect to move the $\sin(x)$ into the integrand. The value of $\sin(x)$ depends on the value of $x$, so you cannot move it inside and outside the integral because it is a function which depends on the value of $x$ and therefore isn't a constant.