Computer saved by bicycle

Yesterday, I finally managed to convince my neigbour to try wxMaxima, the free Math software that does all the tedious calculations for you and let you worry about what to feed it. The outcome of my neighbour trying the software was not entirely successful. For him that is, for me it was a commercial success. He ended up so frustrated that he threw his new netbook out of the open window where it was saved by the basket of my parked bicycle.

The problem below is what led to the frustration. It seemed to be straight forward, but involving a lot of tedious calculations, which is our weakness and wxMaxima’s forte. The sad thing was that the software found two solutions for BD when we were convinced that only one could exist. When my neighbour asked wxMaxima to check its two solutions it said both of them were correct. That is when the netbook went out of the window.

If you know why the software behaved like it did, please post a comment, but don’t tell my neighbour. I would like to keep his netbook.

7 Responses to “Computer saved by bicycle”

1. Richard Sabey Says:

To find the area of this quadrilateral from the data, we need the area of BDC, and for that we need more info about this triangle than we have at present. The only hope is to obtain BD from the data about triangle ADB. This can be found using the cosine rule:

BD² = 125² + 120² – 2 * 125 * 120 * cos 75°

The area of ADB is

AD * (AB sin angle DAB) /2

= 120 * 125 * sin 75° / 2

The area of BDC is

BD * (CD sin CDB) /2

The numbers turn out to be
BD² = 22260.428647 m²
BD = 149.199292 m
area of ADB = 7244.443697 m²
area of BDC = 3356.984063 m²
total area = 10601.427761 m²

I don’t see how the sine rule helps. If I know 3 sides and an angle of a triangle, and I had to find its area, I’d much rather use the formula “area = base * height / 2″ than Heron’s formula.

2. Jan Nordgreen Says:

I like your solution, but please tell me what went wrong in my neighbour’s attempt. Why did he get two values for BD, one correct (149.199292 ) and one wrong (194.3954)?

3. John S. Says:

Your neighbor may want to check whether the angle opposite side BD is really 75º in both cases. I think he will find that it is somewhat larger than that when BD = 194.3954.

4. Jan Nordgreen Says:

So the interesting question is: when will the area and two sides of a triangle uniquely determine the third side?

5. John S. Says:

When the area is maximal, of course!

6. Richard Sabey Says:

Your neighbour’s second value for BD comes from setting angle DAB to that other possible angle with the same sine, namely 105°. The resulting triangle has the same area but a longer BD.

Using H for the area of triangle ABD,

H = AD * (AB sin angle DAB) /2

so

sin angle DAB = 2H / (AD * AB)

so the data determine sin angle DAB, but different values for angle DAB give the same area if those angles have the same sine. In such a case, one angle is acute and its cosine is positive; the other angle is obtuse and its cosine is negative. The length of the third side BD can be calculated using the cosine rule:

BD² = AB² + AD² – 2 AB AD cos angle DAB

Thus, where angle DAB is acute, BD² will be less than AB² + AD², and, where angle DAB is obtuse, BD² will be greater.

To answer the quesion “when do the area and lengths of two sides of a triangle determine the length of the other side?”: it’s when the sine of the angle determines the angle, namely when the sine is 1 so the angle is a right angle, so we have the lengths of the legs of a right-angled triangle, and the formula for the length of the other side, the hypotenuse, simplifies to the formula that comes from Pythagoras’s theorem:

BD² = AB² + AD²

Your neighbour used Heron’s formula for the area of a triangle in terms of the lengths of the sides, so let’s solve the problem using that formula. Suppose we have a triangle of area H and sides of lengths a, b, c, and H, a and b are known, and c is unknown. The question is: under what circumstances is there only one possible value of c?

Where s = (a+b+c)/2,

H² = s(s-a)(s-b)(s-c)
= (a+b+c)(-a+b+c)(a-b+c)(a+b-c)/16
16H² = (a+b+c)(-a+b+c)(a-b+c)(a+b-c)
= [(a+b)+c][(a+b)-c][c-(a-b)][c+(a-b)]
= [(a+b)²-c²][c²-(a-b)²]
-16H² = [c²-(a+b)²][c²-(a-b)²]
= c^4 – 2(a²+b²)c² + [(a+b)(a-b)]²
= c^4 – 2(a²+b²)c² + (a²-b²)²
=> c^4 – 2(a²+b²)c² + (a²-b²)² + 16H² ___ [1]

a quadratic in c². Now, the product of the roots of the quadratic equation Ax²+Bx+C = 0 is C/A. Here, that is (a²-b²)² + 16H². The first of those terms is the square of a real, and thus cannot be negative; the second is positive because H is positive. Thus the product of the roots of the quadratic equation is positive, so those roots have the same sign. If they are positive, both apply to the geometrical problem; if negative, neither applies. Thus, if the geometrical problem has a unique solution, the roots must be equal. (It cannot be that the roots are different but the geometrical problem has a unique solution because one root is applicable, and the other root must be rejected. The only way that could happen is if one root were positive and the other weren’t.)

The roots of the quadratic equation Ax²+Bx+C = 0 are equal iff the discriminant B²-4AC is zero. Here, that is true iff (substituting coefficients from equation [1]):

[2(a²+b²)]² – 4[(a²-b²)² + 16H²] = 0
(a²+b²)² = (a²-b²)² + 16H²
16H² = (a²+b²)² – (a²-b²)²
= (a^4+2a²b²+b^4) – (a^4-2a²b²+b^4)
= 4a²b²
=> H² = a²b²/4
=> H = ab/2 as H, a and b are all positive

The area of a triangle is half the base times the height. Thus the condition for there to be one and only one solution is equivalent to the condition that, where one of the sides whose length we know is the base, the height of the triangle is the other side length we know. This is true iff the triangle is right-angled and the sides whose lengths we know meet at the right angle.

Still supposing that the discriminant B²-4AC of our quadratic equation Ax²+Bx+C is zero, the roots are equal to -B/2A. This implies (substituting coefficients from equation [1]):

c² = 2(a²+b²)/2
= a²+b²

as Pythagoras’s theorem states.

7. John S. Says:

I thought about this in a slightly different way. Consider the two sides a and b and imagine the curve of the area of the triangle as a function of the angle t between a and b. Clearly when t = 0, the area is 0, and when t = 180º, the area is also zero. By Rolle’s theorem, there must also a point on the curve where the derivative is zero. And since the curve is positive definite, this point defines the maximal area. So the curve looks something like a parabola. For any given area less than the maximum, there are two angles (and two possible values for side c) that work. When the area is a maximum, there is only one angle and one value for side c that works.

Solving your equation [1] for H², differentiate with respect to c and set the derivative equal to zero. This also results in c² = a²+b².

How to use LaTeX in a comment.

You can add images to your comment by clicking here.