I wanted to compute the Laplace transform of $$f(t)=\begin{cases}t & 0\le t\le 1\\ 0& \text{otherwise} \end{cases}$$ using the derivative. So I computed $f'(t)=\begin{cases}1 & 0\le t\le 1\\ 0& \text{otherwise} \end{cases}$.
Now $$L(f'(t))(s)=\int_0^1e^{-st}dt=\frac{-1}{s}e^{-s}+\frac{1}{s}$$ Then $$L(f(t))(s)=\frac{1}{s}L(f'(t))(s)+\frac{1}{s}f(0)=\frac{1}{s^2}(1-e^{-s})$$ which does not much the true result if I compute this directly from the integral $$L(f(t)(s)=\int_0^1te^{-st}dt=\frac{1}{s^2}(1-e^{-s})-\frac{e^{-s}}{s} $$ So what is wrong in my computations?
As discussed in the comment section, you must take into account the discontinuities of $f$ at the bounds of its domain when computing its derivative. Actually, you can rewrite $f$ as $t(u(t)-u(t-1))$, where $u$ is the unit step function (or the so-called Heaviside function), whose derivative is nothing else than the Dirac delta function, i.e. $u' = \delta$, hence $f'(t) = u(t)-u(t-1) + t(\delta(t)-\delta(t-1))$. In consequence, one has : $$ \begin{align} \mathscr{L}[f'(t)](s) &= \int_0^\infty (u(t) - u(t-1) + t\delta(t) - t\delta(t-1))e^{-st} \,\mathrm{d}t \\ &= \int_0^1 e^{-st} \,\mathrm{d}t + 0 - e^{-s} \\ &= \frac{1-e^{-s}}{s} - e^{-s} \end{align} $$ and finally $$ \mathscr{L}[f'(t)](s) = \frac{\mathscr{L}[f'(t)](s) + f(0)}{s} = \frac{1-e^{-s}}{s^2} - \frac{e^{-s}}{s}. $$