Question on proof of $1+2+\dots+n=\frac{n(n+1)}{2}$ by induction. I saw some video where it needs to prove $1+2+\dots+n=\frac{n(n+1)}{2}$ inductively. So it has to be true if $k=1$ and $k+1$ are true.
So, for $k=1$:
$$1=\frac{1(1+1)}{2}=\frac{1(2)}{2}=\frac{2}{2}=1$$
it is valid.
For $k+1$ here is the proof he does:
$$
\begin{align}
1+2+\dots+k+k+1&=\frac{(k+1)(k+2)}{2}    &(1)\\
\frac{k(k+1)}{2}+k+1&=\frac{(k+1)(k+2)}{2}  &(2)\\
&=\frac{k^2+2k+k+2}{2}&(3)\\
&=\frac{k^2+3k+2}{2}&(4)\\
&=\frac{(k+1)(k+2)}{2}&\text{factoring (4)}
\end{align}$$
Therefore this formula is valid for $k+1$.

But is this true? I think not. He is just undoing what he have just done. To prove it I think I need to do this:
$$
\begin{align}
1+2+\dots+k+k+1&=\frac{(k+1)(k+2)}{2}\\
\frac{k(k+1)}{2}+k+1&=\frac{(k+1)(k+2)}{2}\\
\frac{k(k+1)+2(k+1)}{2}&=\frac{(k+1)(k+2)}{2}\\
\frac{(k+1)(k+2)}{2}&=\frac{(k+1)(k+2)}{2}\\
(k+1)(k+2)&=(k+1)(k+2)\\
k+1&=k+1\\
k&=k\\
0&=0\text{ or }1=1
\end{align}$$
Therefore, $k+1$ is valid in this formula.
Is this right or am I making a mistake somewhere?

The second way is correct but I would be more carefull and use like this:
$$1+2+...+k+(k+1)=\frac{k(k+1)}{2}+k+1=\frac{k^2+3k+2}{2}=\frac{(k+1)(k+2)}{2}$$
P.s: Not use the equality in the first place. The problem using the equality is that you need guarantee equivalence in every step what is not so easy in many problems.
