I am having trouble understanding how to find the derivative of an integral using the Fundamental Theorem of Calculus (part 1).
$$g(x)=\int_{\sin(x)}^{e^x} \cos(t) \,\mathrm d t$$
What I've done so far:
$g(x)=\int_{\sin(x)}^{e^x} \cos(t)dt$ = $\int_{\sin(x)}^0 \cos(t) dt$ + $\int_0^{e^x} \cos(t) dt$ = $-\int_0^{\sin(x)} \cos(t) dt$ + $\int_0^{e^x} \cos(t) dt$ =>
1.) $ u = \ sin x \implies \frac{d}{du}(-\int_0^u \cos(t) dt)\frac{du}{dx} = - \cos(x) (\cos (u) - \cos(0)) = - \cos(x)[\cos(\sin(x))-1]$
2.) $u =e^x \implies \frac{d}{du}(\int_0^u \cos(t) dt)\frac{du}{dx} = e^x(\cos(u) - \cos(0)) = e^x(\cos(e^x) - 1) \implies g'(x) = - \cos(x) [\cos(\sin(x)) - 1] + e^x\cos(e^x) - e^x$
However, the answer seems weird to me, so I would appreciate any feedback.
Just use Leibniz' rule of differentiating under the integral sign to get: $$g'(x) =\cos(e^x) e^x - \cos(\sin x) \cos x$$