<s>[INST] question on right angle triangle Let ABC and DBC be two equilateral triangle on the same base BC,a point P is taken on the circle with centre D,radius BD. Show that PA,PB,PC are the sides of a right triangle.
 [/INST] 
First let's assume $AB=1$ and call $PB=a;PC=b;PA=c$, we have to prove that $a^2+b^2=c^2$. Applying the law of cosines to $PBC$ with respect to angle $\angle BPC=\pi/6$ we get
$$a^2+b^2-\sqrt3ab=1$$
Now, call $\angle PCB=y$. Applying the law of cosines to $PBC$ with respect to angle $y$ we get
$$  1+b^2-2b\cos y=a^2$$
hence $\cos y=\frac{1+b^2-a^2}{2b}$. From the law of sines on $PBC$ we also get
$\sin y=a/2.$
With these information we can comupte the cosine of angle $\angle PCA=y+\pi/3$:
$$cos(y+\pi/3)=\cos y/2-\sin y \sqrt 3/2.$$
Finally we apply the cosine law on $PAC$ with angle $\angle PCA$:
\begin{align}
c^2&=1+b^2-2b\cos (y+\pi/3) \\
&=1+b^2-2b(\frac{\cos y}{2}-\frac{\sin y \sqrt 3}{2})\\
&=1+b^2-b\big(\frac{1+b^2-a^2}{2b}-\frac{a\sqrt3}{2}\big)\\
&=\frac{1+b^2-a^2}{2}+\frac{ab\sqrt3}{2}
\end{align}
and plugging in the first equation we find:
$$c^2=\frac{1+b^2+a^2}{2}+\frac{a^2+b^2-1}{2}=a^2+b^2.$$
</s>