Computing the derivative of $H(z)= \int_{e^z}^{\cos z} \ln(w^3) ~dw$ I am stuck on this problem:

Find the derivative of the function: $$H(z)= \int_{e^z}^{\cos z} \ln(w^3) ~dw.$$


We will use a (very) modified brute force approach.  Let $f(w)=\ln(w^3)$. The idea is to find an antiderivative $F(w)$ of $f(w)$. Then $H(z)=F(\cos z)-F(e^z)$. Once we have found $F(w)$, we will have an expression for $H(z)$, and differentiation should be easy.
But we don't need to find $F(w)$!  We have 
$$H(z)=F(\cos z)-F(e^z).$$
Differentiate, using the Chain Rule, and recalling that though we never calculated $F(w)$, we know that $F'(w)=f(w)$. We get
$$H'(z)=(-\sin z)f(\cos z)-(e^z)f(e^z).$$
But $f(w)=\ln(w^3)=3\ln w$. Thus 
$$H'(z)=(-\sin z)(3)(\ln(\cos z)) -(e^z)(3)(z).$$
The answer looks nicer if we write it  as $-3\left[\sin z\,\ln(\cos z)+ze^z\right]$.
Comment: In this case, finding $F(w)$, an antiderivative of $\ln(w^3)$, is easy, particularly if we notice that $\ln(w^3)=3\ln w$.  However, the technique we used works for "any" $f(w)$, even if we don't know an antiderivative of $f(w)$.
I went through the full reasoning, but one use the reasoning to obtain a general formula, and after that just use the formula.
Let $f(w)$, $a(z)$, and $b(z)$ be nice functions, and let
$$H(z)=\int_{a(z)}^{b(z)}f(w)\,dw.$$
Then 
$$H'(z)=b'(z)f(b(z))-a'(z)f(a(z)).$$
