# Thread: Law of cosines 2 solutions

1. ## Law of cosines 2 solutions

In a triangle, I know angle a and opposing side A. I also know side B.

Now I use law of cosines to calculate the remaining side C.

But there are two solutions. How do I find both of them? I mean, I find one of them, but how do I derive the other solution?

I have solved it in a clumsy way with calculatons in several steps, taking advantage of the triangle with two sides equal A, if you know what I mean. But is there a simple relationship?

2. Originally Posted by Optiminimal
In a triangle, I know angle a and opposing side A. I also know side B.

Now I use law of cosines to calculate the remaining side C.

But there are two solutions. How do I find both of them? I mean, I find one of them, but how do I derive the other solution?

I have solved it in a clumsy way with calculatons in several steps, taking advantage of the triangle with two sides equal A, if you know what I mean. But is there a simple relationship?
This is the "ambigous case" (if the angle is not included between the sides). So these two possibilities are the two possible triangles.

3. Yes, I see that.
My question is, how can I easily find the second solution?

Code:
C
..
. .
.  .B
. ..
.. .
D .
. .
..
A
Impressive illustration, eh?

I know lengths AB and BD and the angle at A.
The law of cosines sometimes gives AD, sometimes AC.
I'm looking for AC which I know is longer than AB, so I know when I get the "false" solution AD.

My clumsy soultution now is to use the law of sinus to calculate one of the the angles at D (ADB) as ADB = arcsin(AB*sin(A)/BD).

I check that the solution is > 90 becuase the law of sinus too can give too solutions. If < 90, then the correct solution is 180 minus the result.

Then the other angle at D (BDC) is given by 180-ADB.

The angle at C is the same because triangle CBD is isosceles, BC = BD. Therefor angle CBD=180-2*BDC.

The length CD is given by the law of sinus as CD = BD*sin(CBD)/sin(C).

Finally, AC is given as AC = AD+CD.

So, now I wonder if maybe I'm a bit stupid here. Is there a much easier way to find the alternative solution AC when angle A, length AB and the "false" solution AD are known?

And I'm wondering how the computer decides which of the two possible soultions it presents. Is it prefering the short (and for me wrong) solution because it's lazy and wants to save memory?

4. Look at this.

So the givens are: AB, BD and angle A.
You want to find AC easily.

Let AB = c; BD = a; AD = x

By Law of Cosines,
a^2 = x^2 +b^2 -2bx*cosA
x^2 -2bx*cosA +(b^2 -a^2) = 0