# Length of a median

<Moderator's note: Moved from a technical forum and thus no template.>

Hi,

i am quite embarrassed to ask this question, but i am really stuck.

i want to derive length of median of triangle from cosine law and i am getting wrong results. I cannot spot the mistake.

So lets have a triange with sides a,b and c. I would like to find length of a median from vertex A to its opposite side a. Lets call the legth d. So i get two triangles from my original one. One has sides a/2,b,d and the second a/2,c,d. Thus i can write two cosine laws:

$$a^2/4=b^2+d^2-2*b*d*\cos(\alpha/2)$$
$$a^2/4=c^2+d^2-2*c*d*\cos(\alpha/2)$$
where ##\alpha## is angle in vertex A. When i get rid of cosine and solve for d, i get:
$$d=\sqrt (b*c+a^2/4)$$

which is wrong (the answer should look like this https://en.wikipedia.org/wiki/Median_(geometry), or one can just try the formula for equilateral triangle (in this case both equations reduce to the same, but i guess one can take the limit to be able to apply formula even for this case)). Can you help me to spot the mistake?
Thanks:)