Question:
The straight-line $x\cos\alpha+y\sin\alpha=p$ intersects the x & y axes at A & B respectively. Considering $\alpha$ as a variable, show that the equation of the locus that the middle point of AB is a part of is $p^2(x^2+y^2)=4x^2y^2$.
Solution:
$$x\cos\alpha+y\sin\alpha=p$$
$$\implies \frac{x}{\sec\alpha}+\frac{y}{\csc\alpha}=p$$
$$\implies \frac{x}{p\sec\alpha}+\frac{y}{p\csc\alpha}=1$$
$\therefore$ The coordinates of A & B are $(p\sec\alpha,0)$ & $(0, p\csc\alpha)$. Moreover, the midpoint of AB is $(\frac{p\sec\alpha}{2}, \frac{p\csc\alpha}{2})$. Let, $(x,y)$ is the midpoint of any straight line AB. So,
$$(x,y)=(\frac{p\sec\alpha}{2}, \frac{p\csc\alpha}{2})$$
Now,
$$x=\frac{p\sec\alpha}{2}$$
$$\implies2x\cos\alpha=p$$
$$\implies\cos\alpha=\frac{p}{2x}...(i)$$
Again,
$$y=\frac{p\csc\alpha}{2}$$
$$\implies 2y\sin\alpha=p$$
$$\implies \sin\alpha=\frac{p}{2y}...(ii)$$
$(i)^2+(ii)^2:-$
$$\frac{p^2}{4x^2}+\frac{p^2}{4y^2}=1$$
$$\implies p^2(\frac{y^2+x^2}{4x^2y^2})=1$$
$$\implies p^2(x^2+y^2)=4x^2y^2(showed)$$
Now, my problem is with the step when we square and add (i) & (ii). How do we know that we are not introducing extraneous roots? I have a bigger question. How do I know when squaring is valid or not so that I don't have to come to Math SE every time I encounter squaring in my book?
This might help you in answering my question.