If these two equations are to be lines then θ must be a constant as well as k.
(1) cosθ-sinθdy/dx=0 and (2) needs to be rearranged first:
xsinθ+ycosθ=ksinθcosθ=½ksin(2θ) after multiplying through by sinθcosθ. y=-xtanθ+½ksin(2θ)/cosθ.
sinθ+cosθdy/dx=0.
(1) y1'=dy/dx=cotθ (2) y2'=dy/dx=-tanθ. (Calculus is not necessary to determine the slopes of the lines: just divide the negative coefficient of x by the coefficient of y, or write y in terms of x and use the x coefficient.)
The tangent lines for each of these are:
y1=x1cotθ+c1 and y2=-x2tanθ+c2, where c1 and c2 are constants. (Using x1, y1 and x2, y2 helps to distinguish between the two lines, which are always perpendicular to each other, since -tanθ=-1/cotθ, also true for their perpendiculars. θ is the angle between the x- or y-axis.)
Because x1cosθ-y1sinθ=kcos(2θ), so that y1=x1cotθ-kcos(2θ)/sinθ, c1=-kcos(2θ)/sinθ and similarly c2=½ksin(2θ)/cosθ, because the equations of the tangents of straight lines are the equations of the lines themselves. But for convenience we'll stick to c1 and c2 until later in the proof.
The perpendicular lines pass through the origin so (0,0) is a point on each line (no constant term is needed):
y1=-xtanθ and y2=xcotθ because the slopes of the perpendiculars are the negated reciprocals of the tangent slopes. Where the tangent and perpendiculars meet help us to find the lengths of the perpendiculars, p and q.
Therefore, x1cotθ+c1=-x1tanθ where (x1,y1) is the intersection point and similarly:
-x2tanθ+c2=x2cotθ for (x2,y2).
From these x1=-c1/(tanθ+cotθ) and x2=c2/(tanθ+cotθ).
y1=-x1tanθ=c1tanθ/(tanθ+cotθ) and y2=c2cotθ/(tanθ+cotθ).
p2=x12+y12=c12/(tanθ+cotθ)2+c12tan2θ/(tanθ+cotθ)2=c12sec2θ/(tanθ+cotθ)2.
q2=x22+y22=c22/(tanθ+cotθ)2+c22cot2θ/(tanθ+cotθ)2=c22cosec2θ/(tanθ+cotθ)2.
We can now substitute for c1 and c2:
p2=(kcos(2θ)/sinθ)2sec2θ/(tanθ+cotθ)2; q2=(½ksin(2θ)/cosθ)2cosec2θ/(tanθ+cotθ)2.
tanθ+cotθ≡secθcosecθ, therefore 1/(tanθ+cotθ)2=sin2θcos2θ, so p2=k2cos2(2θ), q2=¼k2sin2(2θ).
k2sin2(2θ)=4q2, so k2sin2(2θ)+k2cos2(2θ)=k2=p2+4q2 QED.
Note that this can also be proved using the geometry of right triangles. (In the first equation let x=-ksinθ, y=-kcosθ, so x2+y2=k2, a circle; in the second equation let x=½ksinθ, y=½kcosθ, x2+y2=¼k2.)