<s>[INST] If in ,$r=1$,$R=3$ and $s=5$ then find value of $a^2+b^2+c^2$ If in $\triangle ABC$,$r=1$,$R=3$ and $s=5$, then find value of $a^2+b^2+c^2$
(where $r$=inradius,$R$=circumradius and $s$=semi-perimeter)
The answer given is $24$
 [/INST] I shall attempt to do a step-by-step approach.  You can refer to this for one of the formulas.  Hence, the area of the triangle would be $1 * 5 = 5$.  Using another formula here, $$R = abc/4rs$$.  Hence, $$3 = \frac{abc}{20}$$, so $abc = 60$.  Since $s= 5$, perimeter $$a + b + c$$ = 10.
We have:
$$abc = 60.$$
And $$a + b + c = 10$$
$$(a + b + c)^2 = a^2 + b^2 + c^2 + 2(ab + bc + ac)$$.
Consequently, using Heron's formula, we have $$5^2= 5(5-a)(5-b)(5-c)$$, so we get $$(5-a)(5-b)(5-c) = 5$$.  We have $$125 - 25a - 25b - 25c + 5ab + 5ac + 5bc -abc = 5$$.  Substituting 1 and 2, we have $$125 - 250 + 5(ab + ac + bc) - 60 = 5$$.  This means $$ab + ac + bc = 38$$.  Substitute this into $$(a + b + c)^2= a^2 + b^2 + c^2 + 2(ab + bc + ac)$$, we get $$100 = a^2 + b^2 + c^2 + 2*38$$.  Hence, $$a^2 + b^2 + c^2 = 100 - 76 = 24$$.
Note:
Any helpful user please help me format my code to look like simultaneous equations.  Thanks.
</s>