Find the derivative of this integral

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.

• Should have been $$g(x) = \int_{\sin(x)}^{e^x} \cos(t) \,\mathrm d t = \int_{-\infty}^{e^x} \cos(t) \,\mathrm d t - \int_{-\infty}^{\sin(x)} \cos(t) \,\mathrm d t$$ – Rodrigo de Azevedo Jan 23 '18 at 15:18
• What if I do another way: $\frac{d}{dx}$$[g(x)=\int_{sin(x)}^{e^x}cos(t)dt] = \frac{d}{dx} [F (e^x) - F (sin(x))] = F' (e^x)e^x' - F'(sin(x))sin'(x) = f(e^x)e^x - f(sin(x))cos(x) = e^xcos(e^x) - cos(sin(x))cos(x) Is this still a correct solution? – Liza Jan 23 '18 at 15:35 1 Answer Just use Leibniz' rule of differentiating under the integral sign to get:$$g'(x) =\cos(e^x) e^x - \cos(\sin x) \cos x$$• Well, thank you, I got this answer when I reviewed my work. However, would you be able to point out on the mistake I made above? – Liza Jan 23 '18 at 15:15 • Note that you could saved yourself the trouble, by integrating$\cos t\$, a relatively simple function. – Rohan Jan 23 '18 at 15:34
• Done. Thank you for your help. – Liza Jan 23 '18 at 18:01