Let
[tex]P(n):\ 1+2+\ldots+n = \dfrac{n(n+1)}{2}[/tex]
In order to prove this by induction, we first need to prove the base case, i.e. prove that P(1) is true:
[tex]P(1):\ 1 = \dfrac{1\cdot 2}{2}=1[/tex]
So, the base case is ok. Now, we need to assume [tex]P(n)[/tex] and prove [tex]P(n+1)[/tex].
[tex]P(n+1)[/tex] states that
[tex]P(n+1):\ 1+2+\ldots+n+(n+1) = \dfrac{(n+1)(n+2)}{2}=\dfrac{n^2+3n+2}{2}[/tex]
Since we're assuming [tex]P(n)[/tex], we can substitute the sum of the first n terms with their expression:
[tex]\underbrace{1+2+\ldots+n}_{P(n)}+n+1 = \dfrac{n(n+1)}{2}+n+1=\dfrac{n(n+1)+2n+2}{2}=\dfrac{n^2+3n+2}{2}[/tex]
Which terminates the proof, since we showed that
[tex]P(n+1):\ 1+2+\ldots+n+(n+1) =\dfrac{n^2+3n+2}{2}[/tex]
as required