Problem statement:
Prove that if the altitude and median drawn from the same vertex of a nonisosceles triangle lie inside the triangle and form equal angles with its sides, then this is a right triangle.
After many attempts, I came up with this: let $ABC$ be the triangle where $CH$ is the altitude, $CM$ is the median, and name the angles $ACH = MCB = \theta$, $CAH = \alpha$, $CBM = \beta$ and $HCM = \gamma$. Using the sine theorem in the triangle $CMB$ we get $$\frac{MB}{\sin(\theta)} = \frac{MC}{\sin(\beta)},$$ while using the sine theorem in the triangle $ACM$ we get $$\frac{MC}{\sin(\alpha)} = \frac{MA}{\sin(\theta + \gamma)}.$$ Combining these equations I found $$\sin(\alpha) \sin(\theta) = \sin(\beta) \sin(\theta + \gamma).$$ Applying the identity $$\sin(a)\sin(b) = \frac{\cos(a-b) - \cos(a+b)}{2}$$ I concluded $$\cos(\alpha - \theta) = \cos(\theta + \gamma - \beta).$$ Since all angles are within $[0, \pi]$ range I concluded $$\alpha - \theta = \theta + \gamma - \beta,$$ thus $2 \theta + \gamma = \alpha + \beta$. From the original triangle we know $$2 \theta + \gamma + \alpha + \beta = \pi,$$ and combining the equations proves the triangle is right.
Is this correct? Is there a synthetic way to do it?



Extend median $\overline{AM}$ of $\triangle ABC$ to meet the circumcircle at $M'$, and let $D$ be the foot of the altitude from $A$. (Note that $D$ and $M$ are distinct —and, thus, $\overline{AM'}\not\perp\overline{BC}$— because we assume $\triangle ABC$ is non-isosceles.)
Since $\angle M' \cong\angle B$ (by the Inscribed Angle Theorem), we conclude $\angle ACM'\cong\angle ADB=90^\circ$, so that $\overline{AM'}$ is a diameter. Now, a diameter can only bisect a non-perpendicular chord at its own midpoint (aka, the circumcenter); consequently, $M$ is that circumcenter, $\overline{BC}$ is a diameter, and $\angle BAC$ is a right angle. $\square$