Applic. Of derivatives The straight line $x\cos \alpha + y \sin \alpha = p$ touches the curve $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1$. Prove that $a^{2}\cos 2\alpha+b^{2} \sin 2\alpha=p^{2}$

Notice, solving the given equations by setting $y=\frac{p-x\cos \alpha}{\sin\alpha}$ in the equation of the curve: $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$, we get $$\frac{x^2}{a^2}+\frac{\left(\frac{p-x\cos \alpha}{\sin\alpha}\right)^2}{b^2}=1$$ $$b^2x^2\sin^2\alpha+a^2(p-x\cos \alpha)^2=a^2b^2\sin^2\alpha $$
$$(a^2\cos^2\alpha+b^2\sin^2\alpha)x^2-2(a^2p\cos\alpha)x+(a^2p^2-a^2b^2\sin^2\alpha)=0$$
Since, the straight line touches the curve (ellipse), hence the roots of the above quadratic equation should be equal hence the discriminant $\Delta=B^2-4AC=0$
$$(-2a^2p\cos\alpha)^2-4(a^2\cos^2\alpha+b^2\sin^2\alpha)(a^2p^2-a^2b^2\sin^2\alpha)=0$$
$$a^4b^2\sin^2\alpha\cos^2\alpha+a^2b^4\sin^4\alpha-a^2b^2p^2\sin^2\alpha=0$$
 Dividing the equation by $a^2b^2\sin^2\alpha$, we get 
$$a^2\cos^2\alpha+b^2\sin^2\alpha-p^2=0$$ $$\color{red}{a^2\cos^2\alpha+b^2\sin^2\alpha=p^2}$$
