<s>[INST] Triple Angle Condition Let $ABC$ be a triangle with integral side lengths such that $\angle A=3\angle B$. Find the minimum value of its perimeter.
Essentially we want sinb, sin3b, sin4b to have rational ratios (manipulate the sine law). But then we don't actually need sinb to be rational, so that's pretty mysterious. Afterwards just make them integers by multiplying by LCM of denominator.
 [/INST] Let $x = \sin\angle B$. Using the identity $\sin 3\theta = -4\sin^3 \theta + 3\sin\theta$, $\sin\angle A = -4x^3+3x$.
Then $\sin\angle C = \sin (\pi - \angle B - \angle A) = \sin 4\angle B = 4\sin\angle B\cos\angle B(1-2\sin^2 \angle B) =4x\sqrt{1-x^2}(1-2x^2) $.
By the law of sines, $\frac{a}{b} = \frac{\sin\angle A}{\sin\angle B} = -4x^2+3$, etc.
The perimeter is therefore
$$ a+b+c = 4b\left[ 1-x^2+\sqrt{1-x^2}(1-2x^2) \right]$$
We want to minimize this subject to the quantity in brackets being rational.
Note also that $0 < \angle B < \pi/4$, so $0<x<1/\sqrt{2}$.
We need $x^2$ to be rational, so let $x^2 = p/q$. Since we also need $\sqrt{1-x^2}$ to be rational, both $q$ and $q-p$ must be squares. Let $q=a^2$, and $a^2-p = b^2$, with $2p<a^2$. Substituting this all back in, we get the following optimization problem:
$$ \min\; a^3-pa+ba^2-2bp $$
subject to $a$, $b$, $p$ being positive integers, $2p<a^2$, and $a^2-p=b^2$.
The objective is cubic in $a$, so we should try to find the smallest $a$. From the constraints, we see that $a\ge 3$, and the second constraint prevents $a=3$ from being a possibility. The next possibility is $a=4$, leading to $p=7$, and $b=3$. Plugging this in gives side lengths $b$, $a=\frac{5}{4}b$, and $c=\frac{3}{8}b$. Multiplying through by 8 gives 3, 8, 10 as side lengths, for a perimeter of 21.
</s>