<s>[INST] Trigonometry AS I've been trying this question for a while but still don't understand it. Do you use trigonometry to form a equation for the sides and then add them up as you know the perimeter is 40?
 [/INST] Construct a perpendicular from $B$ to $AC$ such that it touches $AC$ at point $D$.
Using the fact that Perimeter is $40cm$
$$a+b+14=40 \\ \Rightarrow a=26-b\\ $$
Using Pythagoras Theorem on Triangle $ABD$, $$\ \ \ \ \ (26-b)^2=BD^2+AD^2 \\\Rightarrow (26-b)^2 -AD^2=BD^2 \\ \\ \\ \\ \\ \\$$
Using Pythagoras Theorem on Triangle $CBD$,
$$\begin {align}
  \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ b^2&=(26-b)^2-AD^2+DC^2\\
&=(26-b)^2-(14-DC)^2+DC^2\\
&=676+b^2-52b-196-DC^2+28DC+DC^2\\
\\ \Rightarrow 0&=480 -52b+28DC\\
\Rightarrow DC&=\frac{52b-480}{28}=\frac {13b}{7}-\frac {120}{7}\\
\Rightarrow \frac {DC}{b} &=\cos \theta= \frac {13}{7}-\frac {120}{7b} 
\end {align}$$
</s>