Geometry Math Problem: Find the Height of the Triangle

Find the height of the triangle if
ABC is a right angle triangle, Where AB = 8 cm and PN = 1 cm
AB is the diameter of the semicircle and PN is the radius of the circle
AC & AB are tangents of the circle also AC is the tangent of the semicircle

Solution: Height of the triangle
We can redraw the diagram

Let MC = NC = x and ∠MCN = θ
Then heght of the triangle is 4 + x
From figure
∠PMC = ∠PNC = 90° (AC & BC are tangents)
⇒ ∠MPN = 360 – (∠PMC + ∠PNC + θ)
so, ∠MPN = 360 – (90 + 90 + θ)
⇒ ∠MPN = 180 – θ
AQ = BQ = 4 cm (radius of the semicircle)
PN = PM = 1 cm
AR = PM = 1 cm
⇒ RQ = 4 – 1 = 3 cm
From △PQR
PQ² = PR² + QR² (Pythagorean theorem)
⇒ 5² = PR² + 3²
then, PR = 4 cm
⇒ AM = PR = 4 cm
Apply cosine rule in triangle MCN
MN² = CM² + CN² – 2 × CM × CN × cos θ (Cosine Rule)
⇒ MN² = x² + x² – 2 × x × x × cos θ
⇒ MN² = 2x² – 2x² cos θ
Apply cosine rule in triangle MPN
MN² = PM² + PN² – 2 × PM × PN × cos (180-θ) (Cosine Rule)
⇒ MN² = 1 + 1+ 2 × 1 × 1 × cos θ
⇒ MN² = 2+ 2 cos θ
so, MN² = 2+ 2 cos θ = 2x² – 2x² cos θ
⇒ x² cos θ + cos θ = x² – 1
Now, cos θ = ( x² – 1 )/( x² + 1 )
⇒ tan θ = 2x/(x² – 1)
From △ABC
tan θ = AB/AC = AB/(AM + x)
⇒ tan θ = 8/(4 +x )
so, tan θ = 8/(4 +x) = 2x/(x² – 1)
⇒ 8( x² – 1 ) = 2x(4 +x)
so, 8x² – 8 = 8x + 2x²
⇒ 6x² – 8x – 8 = 0
This is a quadratic equation so apply quadratic equation formula
x=\frac{-8 \pm \sqrt{64 + 4 \times 6 \times 8}}{2 \times 6}
⇒ x = 2, -2/3
so we get x = 2 because length is always positive
AC = 4 + x = 4 + 2
⇒ Height of the triangle = 6 cm