# In triangle PQR, how do you express cosQ in terms of p, q, r?

$\cos Q = \frac{{p}^{2} + {r}^{2} - {q}^{2}}{2 p r}$
Here side $p$ is opposite $\angle P$, side $q$ is opposite $\angle Q$ and side $r$ is opposite $\angle R$.
$\cos Q$ is then (sum of squares of other (other than $q$) two sides minus square of side opposite $\angle Q$ i.e $q$) divided by (twice the product of other two sides).