# Incorrect integral in textbook?

I saw this integral in my textbook. Is this incorrect? Shouldn't it be $-\lambda e^{-\lambda s}$ since the integral of $e^{-\lambda s}$ is $-\frac{1}{\lambda}e^{-\lambda s}$

\begin{align*} f_S(s) &=\lambda^2\int_0^se^{-\lambda s}\,dt\\ &=\lambda^2se^{-\lambda s} \end{align*}

Image.

-
You are integrating with respect to t, not s. Where's the t in the integral? – Graham Kemp Mar 5 at 2:43
@GrahamKemp yeah as I stated in my comment below, I was thrown off by the fact that they moved $\lambda^{2}$ outside of the integral but left the rest inside. Thought maybe the dt was a typo and was supposed to read ds. In any case, thanks for your answer. – A user Mar 5 at 3:02

The integral is with respect to $t$, not $s$.   So $\mathsf e^{-\lambda s}$ is relatively constant to $t$.

\begin{align} f(s) & = \lambda^2\int_0^s \mathsf e^{-\lambda s}\operatorname d t \\[1ex] & = \lambda^2 ~\mathsf e^{-\lambda s}\int_0^s \operatorname d t \\[1ex] & = \lambda^2 ~\mathsf e^{-\lambda s}~(s-0)\\[1ex] & = \lambda^2 ~s ~\mathsf e^{-\lambda s} \end{align}

-
Small typo: You mean $s$ as the upper limit. – Mankind Mar 5 at 2:50
@GrahamKemp ah, gotcha. That's what I thought, but it seemed weird that the book moved $\lambda^{2}$ outside of the integral while it kept $e^{-\lambda s}$ inside, don't you think? – A user Mar 5 at 2:51
?doh! @HowDoIMath Thank you. – Graham Kemp Mar 5 at 3:11

$$\lambda^2\int_0^s e^{-\lambda s}\,dt = \lambda^2e^{-\lambda s}\int_0^s\,dt = \lambda^2e^{-\lambda s}\big[t\big] \bigg|_0^s = \lambda^2e^{-\lambda s}s = \lambda^2 se^{-\lambda s}.$$

-
Are math-only answers encouraged here, unlike code only answers on SO? – cat Mar 5 at 4:52
@tac I wouldn't say they are encouraged. Long story short, they are acceptable. – probablyme Mar 5 at 4:55