proof of stewart's theorem in hyperbolic geometry

Stewart's Theorem in Hyperbolic Geomatry
In hyperbolic triangle ABC, if D lies on the hyperbolic line BC and the
segments have hyperbolic lengths d(A,B)=c, d(B,C)=a, d(C,A)=b,
d(A,D)=d, d(B,D)=m, d(D,C)=n, then
(1) if D lies between B and C, then sinh(a)cosh(d) = sinh(m)cosh(b)+sinh(n)cosh(c),
(2) if D lies beyond C, then sinh(a)cosh(d) = sinh(m)cosh(b)-sinh(n)cosh(c),
(3) if D lies beyond B, then sinh(a)cosh(d) =-sinh(m)cosh(b)+sinh(n)cosh(c).

By the hyperbolic Cosine Rule applied to hyperbolic triangles ABD, ADC,
we have
cos(<ADB) = (cosh(d)cosh(m)-cosh(c))/sinh(d)sinh(m),
cos(<ADC) = (cosh(d)cosh(n)-cosh(b))/sinh(d)sinh(n),

(1) Here <ADC = π-<ADB, so cos(<ADC)=-cos(<ADB), so that
(cosh(d)cosh(m)-cosh(c))/sinh(d)sinh(m) = -(cosh(d)cosh(n)-cosh(b))/sinh(d)sinh(n).
Simplifying this, we get
cosh(d)(sinh(m)cosh(n)+sinh(n)cosh(m))= sinh(m)cosh(b)+sinh(n)cosh(c).
But sinh(m)cosh(n)+sinh(n)cosh(m) = sinh(m+n). As m+n=a, we have (1).

(2) Now <ADC = <ADB, so we get
(cosh(d)cosh(m)-cosh(c))/sinh(d)sinh(m) = (cosh(d)cosh(n)-cosh(b))/sinh(d)sinh(n).
Simplifying this, we get
cosh(d)(sinh(m)cosh(n)-sinh(n)cosh(m))= sinh(m)cosh(b)-sinh(n)cosh(c).
But sinh(m)cosh(n)-sinh(n)cosh(m) = sinh(m-n). As m-n=a, we have (2).

(3) The algebra is identical to that in (2), but here n-m=a, so we get (3).

stewart's theorem