The line $lx+my=1$ intersects the circle $x^2+y^2=a^2$ at points $A$, $B$ . . . Problem: 

The line $lx+my=1$ intersects the circle $x^2+y^2=a^2$ at points $A$, $B$. If $AB$ subtends $\frac{\pi}{4}$ at origin then find $a^2(l^2+m^2)$ 

My approach: 
Can we find point of intersection of line and circle by putting $x = \frac{1-my}{l}$? But this way I am not getting the answer. Please suggest how to proceed in this. Thanks.
 A: hint: 
Let $A = (x_1,x_2), B = (y_1,y_2)$, then: $lx_1+my_1 = 1 = lx_2+my_2  \to l(x_1-x_2) = -m(y_1-y_2)$, and $(x_1-x_2)^2+(y_1-y_2)^2 = AB^2 = a^2+a^2 - \sqrt{2}a^2$ by law of cosine and $r = a$. Let $p = x_1-x_2, q = y_1 - y_2$, you can then solve for $p,q$ in terms of $a,l,m$. Its a starting point.
A: Homogenize the line with the circle:
$$x^2+y^2=a^2(lx+my)^2$$
Rearrange to get the equation of pair of lines:
$$x^2(a^2l^2-1)+y^2(a^2m^2-1)+2a^2lmxy=0\tag{i}$$

The angle between the line pair $px^2+2qxy+ry^2=0$ is given by $\pm\tan\theta=\dfrac{2\sqrt{q^2-pr}}{p+r}$

In this case $\tan\theta=\pm1$, can you take it from here?
A: Substitute for both intersection points $x_0 = a \cos (\phi)$, $y_0 = a \sin (\phi)$, and $x_1 = a \cos ({\phi+\pi/4})$, $y_1 = a \sin ({\phi+\pi/4})$ into the line equation. Use the angle-sum rule in the second of these equations and something will cancel to 1.
Hint 1:

 After that, you have to square the whole expression. A little trigonometric algebra leads directly to the solution.

Solution:

 $4- 2 \sqrt{2}$

