## Brahmagupta’s formula

Posted: April 11, 2013 in Mathematics

Three months ago I post a complex number proof of Heron’s formula, and today I am gonna show you a proof of Brahmagupta’s formula.  Brahmagupta’s formula is basically a generalization of Heron’s formula.  Brahmagupta was a great Indian mathematician (597–668 AD).

Brahmagupta’s Formula

Given a cyclic quadrilateral ABCD with side length of a, b, c, and d.  And let semi-perimeter be s such that,

$s=\dfrac{a+b+c+d}{2}$

then the area of the cyclic quadrilateral is

$Area=\sqrt{(s-a)(s-b)(s-c)(s-d)}$

Note that this formula works only if the quadrilateral is cyclic, which means that the opposite angles of the quadrilateral are supplementary.

$A+C=180^\circ$ and $B+D=180^\circ$

or in other words, the quadrilateral ABCD is cyclic if it can be inscribed inside a circle.

Proof:

Join the line segment BD with length x, then apply the cosine law on triangle ABD and triangle BCD.

$x^2=a^2+d^2-2ad\cos A$

$x^2=b^2+c^2-2bc\cos C$

hence we have

$a^2+d^2-2ad\cos A = b^2+c^2-2bc\cos C$

Since A + C = 180 degrees, we have

$\cos A = \cos (180^\circ - C) = -\cos C$

so,

$a^2+d^2-2ad\cos A = b^2+c^2+2bc\cos A$

$\cos A = \dfrac{a^2+d^2-b^2-c^2}{2ad+2bc}$

Now the area of the quadrilateral ABCD is the sum of the areas of the triangle ABD and triangle BCD, we have

$Area = \dfrac{1}{2}ad\sin A + \dfrac{1}{2}bc\sin C$

Since A + C = 180 degrees, we have

$\sin A = \sin C$

hence,

$Area = \dfrac{1}{2}ad\sin A + \dfrac{1}{2}bc\sin A = \dfrac{ad+bc}{2}\sin A$

let’s square both sides for convenient and apply the pythagoras trig identity,

$Area^2 = \dfrac{(ad+bc)^2}{4}\sin^2 A$

$Area^2=\dfrac{(ad+bc)^2}{4}(1-\cos^2 A)$

$Area^2=\dfrac{(ad+bc)^2}{4}\left(1-\dfrac{(a^2+d^2-b^2-c^2)^2}{4(ad+bc)^2}\right)$

$Area^2=\dfrac{1}{16}\bigg(4(ad+bc)^2-(a^2+d^2-b^2-c^2)^2\bigg)$

Now, factor the polynomial in the bracket,

$Area^2=\dfrac{1}{16}(2ad+2bc-a^2-d^2+b^2+c^2)(2ad+2bc+a^2+d^2-b^2-c^2)$

$Area^2=\dfrac{1}{16}(b^2+c^2+2bc-a^2-d^2+2ad)(a^2+d^2+2ad-b^2-c^2+2bc)$

$Area^2=\dfrac{1}{16}\bigg((b+c)^2-(a-d)^2\bigg)\bigg((a+d)^2-(b-c)^2\bigg)$

$Area^2=\dfrac{1}{16}(b+c-a+d)(b+c+a-d)(a+d-b+c)(a+d+b-c)$

$Area^2=\dfrac{b+c+d-a}{2}\cdot\dfrac{a+c+d-b}{2}\cdot\dfrac{a+b+d-c}{2}\cdot\dfrac{a+b+c-d}{2}$

Now, since $s=\dfrac{a+b+c+d}{2}$, so

$s-a = \dfrac{a+b+c+d}{2} - \dfrac{2a}{2} = \dfrac{b+c+d-a}{2}$

Therefore,

$Area^2=(s-a)(s-b)(s-c)(s-d)$

$Area = \sqrt{(s-a)(s-b)(s-c)(s-d)} \qquad \blacksquare$

Special case: The Heron’s formula

Now if one of the side length of the cyclic quadrilateral approaches to zero, then it becomes the Heron’s formula

Since all triangles are cyclic,

$s=\dfrac{a+b+c+d}{2} \stackrel{(d \to 0)}{=} \dfrac{a+b+c}{2}$

$Area = \sqrt{(s-a)(s-b)(s-c)(s-d)} \stackrel{(d \to 0)}{=} \sqrt{s(s-a)(s-b)(s-c)}$

## 2nd and last post on DEs, I promise :p

Posted: April 3, 2013 in Mathematics

Now I am neither an engineer nor a physics major, so I am not so sure if my solution is correct.  Don’t trust me on this, I don’t know physics 🙂

My guess is

$m\cdot\dfrac{dv}{dt}=mg-kv$

here m, g, and k are fixed constant.  Then if you trust me on this, read on

Since mass is non-zero,

$\dfrac{dv}{dt}=g-\dfrac{kv}{m}$

$\dfrac{dv}{dt}+\dfrac{k}{m}\cdot v=g$

Just like the last post, the integrating factor is

$e^{\int k/m \, dt} = e^{kt/m}$

Then

$\dfrac{dv}{dt}e^{kt/m}+\dfrac{k}{m}\cdot ve^{kt/m}=ge^{kt/m}$

$\dfrac{d}{dt}ve^{kt/m}=ge^{kt/m}$

$ve^{kt/m}=\displaystyle \int ge^{kt/m}\,dt$

$ve^{kt/m}=\dfrac{gm}{k}e^{kt/m} + C$

$v=\dfrac{gm}{k}+Ce^{-kt/m}$

Since when $t=0, v=v_0$, then we have

$v_0=\dfrac{gm}{k}+C$

$\therefore C=v_0-\dfrac{gm}{k}$

Finally,

$v=\dfrac{gm}{k}+\left(v_0-\dfrac{gm}{k}\right)e^{-kt/m}$

Now, I have no idea if the initial velocity is zero or not coz I don’t really fully understand the problem, I ain’t expert in physics, so if

$v_0=0$

then

$v=\dfrac{gm}{k}-\dfrac{gm}{k}\cdot e^{-kt/m}$

otherwise,

$v=\dfrac{gm}{k}+\left(v_0-\dfrac{gm}{k}\right)e^{-kt/m}$

## solving first order ODE with integrating factor

Posted: April 3, 2013 in Mathematics

Personally, I don’t like DEs because they are boring, a bit too much of calculation for my liking.  Maybe this is my first and last post on DEs here.

Anyway, this is for a friend’s request…

So how do we solve non-separable ODE of this type?

$\dfrac{dy}{dx}+p(x)y=q(x)$

The answer is multiplying both sides by the integrating factor.

$e^{\int p(x)\, dx}$

The idea comes from the product rule and this, since

$\frac{d}{dx}ye^x = y'e^x+ye^x$

and if we replace the exponent of $e$ with $\int p(x)\,dx$, then

$\dfrac{d}{dx}e^{\int p(x)\, dx}=p(x)e^{\int p(x)\, dx}$ by chain rule

Therefore

$y'+p(x)y=q(x)$

becomes

$y'e^{\int p(x)\, dx}+p(x)ye^{\int p(x)\, dx}=q(x)e^{\int p(x)\, dx}$

$\dfrac{d}{dx} ye^{\int p(x)\, dx} = q(x)e^{\int p(x)\, dx}$

then

$\displaystyle y=e^{-\int p(x)\, dx}\int q(x)e^{\int p(x)\, dx} \,dx$

For example

$y'+y=e^{-x}, \quad y(0)=1$

then the integrating factor is

$e^{\int p(x)\, dx} = e^{\int dx} = e^x$

hence, we have

$y'e^x+ye^x=e^{-x}e^x$

$\dfrac{d}{dx} ye^x = 1$

$\displaystyle ye^x=\int dx = x+C$

since the initial value $y(0)=1$, we have

$(1)e^0=0+C$

$C=1$

Therefore

$ye^x=x+1$

$y=\dfrac{x+1}{e^x}$

## an interesting highschool geometry question

Posted: April 1, 2013 in Mathematics

During the long easter weekend, I finally have time to check out the web and forums and I found this nice little geometry problem on triangles.  At first glance the problem looks difficult, however it is not too bad after figuring out some of the angles and realizing couple isosceles triangles in it.

Solution

First of all let’s label the points A, B, C, D, E, and F in the diagram.

Obviously, triangle ABC, triangle BCD, and triangle ABF are isosceles triangles.  Let

$AB=AC=BF=k, \quad BD=BC=a$

and let

$CD=b, \quad AD=c$

In isosceles triangle ABC, we have

$\dfrac{a}{2k}=\cos{48}$

$a=2k\cos{48}$

In isosceles triangle BCD, we have

$\dfrac{b}{2a}=\cos{72}$

$b=2(2k\cos 48)\cos 72=4k\cos 72 \cos 48$

Then apply the Product-to-Sum identity

$\cos{A}\cos{B}=\dfrac{\cos(A+B)+\cos(A-B)}{2}$

We have

$b=2k(\cos 120 + \cos 24)=(2\cos24-1)k$

Now apply the cosine law on triangle ACD,

$c^2=k^2+b^2-2kb\cos 24$

$c^2=k^2+(2\cos24-1)^2k^2-2k((2\cos24-1)k)\cos24$

$c^2=k^2(1+4\cos^2{24}-4\cos{24}+1-4\cos^2{24}+2\cos{24})$

$c^2=k^2(2-2\cos24)$

And then finally apply sine law in triangle ABD,

$\dfrac{\sin x}{k}=\dfrac{\sin 12}{c}$

$\dfrac{\sin x}{k}=\dfrac{\sin 12}{k\sqrt{2-2\cos24}}$

Then apply double angle identity,

$\cos(2\theta)=1-2\sin^2\theta$

$\sin x = \dfrac{\sin 12}{\sqrt{2-2(1-2\sin^2{12})}}$

$=\dfrac{\sin 12}{\sqrt{4\sin^2{12}}}=\dfrac{1}{2}$

$\therefore x=30$

Therefore angle x is 30 degrees.

Remarks:

Some additional beautiful results can be found if we solve x differently, but I will leave this for next time. 🙂