Let the sides be a, b, and c.
c2=a2+b2−2abcosC.
You can replace c, a, and b interchangeably. This should help:
https://en.wikipedia.org/wiki/Law_of_cosines