You need to use the law of cosines such that:

`c^2 = a^2 + b^2 - 2ab*cos C => cos C = (a^2 + b^2 - c^2)/(2ab)`

`cos B = (a^2 + c^2 - b^2)/(2ac) `

`cos A = (b^2 + c^2 - a^2)/(2bc)`

Substituting `(a^2 + c^2 - b^2)/(2ac)` for `cos B` and `(b^2 + c^2 - a^2)/(2bc)` for `cos A` yields:

`c = acosB + bcosA`

`c = a*(a^2 + c^2 - b^2)/(2ac) + b*(b^2 + c^2 - a^2)/(2bc)`

Reducing duplicate factors, yields:

`c = (a^2 + c^2 - b^2)/(2c) + (b^2 + c^2 - a^2)/(2c)`

Bringing both sides to a common denominator, yields:

`2c*c = a^2 + c^2 - b^2 + b^2 + c^2 - a^2`

Reducing duplicate terms `a^2` and `b^2` , to the right side, yields:

`2c^2 = 2c^2 => c = c`

**Hence, testing if the expression `c = acosB + bcosA` holds, using the law of cosines, yields that `c = acosB + bcosA` is a valid expression**.