Given $\triangle ABC$, we have$$c=a\cos B+b\cos A\tag{1}$$
Where $a=BC$, $b=AC$ and $c=AB$.
Question: How do you prove the relation?
I started with$$\begin{align*} & CD=a\cos B\\ & CD=b\cos A\end{align*}$$ So adding them up gives$$2CD=a\cos B+b\cos A$$However, what's confusing is how $2CD=c$ for the equation $(1)$ to hold.
