If we translate everything that we're told in a Cartesian diagram and by assigning the bottom of the screen as the origin point, we then get
View attachment 1197
[TABLE="class: grid, width: 500"]
[TR]
[TD]The gradient of the straight line that connects the point $(-w-x, x\tan \theta-h)$ and $(0, 0)$ is $$\tan k^{\circ}=\frac{x\tan \theta-h}{-w-x}=\frac{h-x\tan \theta}{w+x}$$[/TD]
[TD]The gradient of the straight line that connects the point $(-w-x, x\tan \theta-h)$ and $(0, S)$ is $$\tan m^{\circ}=\frac{x\tan \theta-h-S}{-w-x}=\frac{h+S-x\tan \theta}{w+x}$$[/TD]
[/TR]
[TR]
[TD]Hence, $$k^{\circ}=arc \tan \left(\frac{h-x\tan \theta}{w+x}\right)$$[/TD]
[TD]Hence, $$m^{\circ}=arc \tan \left(\frac{h+S-x\tan \theta}{w+x}\right)$$[/TD]
[/TR]
[/TABLE]
Therefore, the viewing angle, $\beta$ is
$$\beta^{\circ}=m^{\circ}-k^{\circ}=arc \tan \left(\frac{h+S-x\tan \theta}{w+x}\right)-arc \tan \left(\frac{h-x\tan \theta}{w+x}\right)$$
One of the credible ways to maximize the viewing angle $\beta$ is through the differentiation method.
$$\frac{d\beta}{dx}=\frac{d \left( arc \tan \left(\frac{h+S-x\tan \theta}{w+x}\right)\right)}{dx}-\frac{d \left(arc \tan \left(\frac{h-x\tan \theta}{w+x}\right)\right)}{dx}$$
$$\;\;\;\;\;\;=\left(\small\frac{1}{1+\left(\frac{h+S-x\tan \theta}{w+x}\right)^2}\right)\left(\tiny\frac{(-\tan x)(w+x)-h-S+x\tan \theta}{(w+x)^2}\right)-\left(\small\frac{1}{1+\left(\frac{h+S-x\tan \theta}{w+x}\right)^2}\right)\left(\small\frac{(-\tan x)(w+x)-h-S+x\tan \theta}{(w+x)^2}\right)$$
$$\;\;\;\;\;\;=\left(\frac{-w\tan \theta-h-S}{(w+x)^2+(h+S-x\tan \theta)^2}\right)-\left(\frac{-w\tan \theta-h}{(w+x)^2+(h-x\tan \theta)^2}\right)$$
$$\;\;\;\;\;\;=\left(\frac{P-S}{Q+(R+S)^2}\right)-\left(\frac{P}{Q^2+R^2}\right)$$
$$\;\;\;\;\;\;=\left(\frac{PQ^2+PR^2-SQ^2-SR^2-PQ^2-PR^2-2PRS-PS^2}{(Q+(R+S)^2)(Q^2+R^2)}\right)$$
$$\;\;\;\;\;\;=\left(\frac{-S(Q^2+R^2+2PR+PS)}{(Q+(R+S)^2)(Q^2+R^2)}\right)$$
where
$P=-w\tan \theta-h$, $Q=w+x$, and $R=h-x\tan \theta$.
Keep in mind that our aim is to find for the corresponding $x$ value when maximum $\beta$ occurs.
i.e. we need to equate $\frac{d\beta}{dx}=0$ and this can be achieved only when $Q^2+R^2+2PR+PS=0$, in other words, what we're dealing now is
$$(w+x)^2+(h-x\tan \theta)^2+2(-w\tan \theta-h)(h-x\tan \theta)+S(-w\tan \theta-h)=0$$
Solving this for $x$, we have
$$w^2+2wx+x^2+h^2-2hxtan \theta+x^2\tan^2 \theta-2(w\tan \theta+h)(h-x\tan \theta)-S(w\tan \theta+h)=0$$
$$\small x^2\sec^2 \theta+2x(w-h\tan \theta+w\tan^2 \theta+h\tan \theta)+w^2+h^2-2(w\tan \theta+h)+2x\tan \theta(w\tan\theta+h)-Sw\tan \theta-Sh=0$$
$$x^2\sec^2 \theta+2x(w\sec^2 \theta)+w^2-h^2-Sh-w\tan \theta(S+2h)=0$$
Quadratic formula tells us
$$x=\frac{-2w\sec^2 \theta \pm \sqrt{4w^2\sec^4 \theta-4\sec^2 \theta(w^2-h^2-Sh-w\tan \theta(S+2h))}}{2\sec^2 \theta}$$
$$x=-w\pm\frac{\sqrt{w^2\sec^2 \theta- (w^2-h^2-Sh-w\tan \theta(S+2h))}}{\sec \theta}$$
$$x=-w\pm\frac{\sqrt{w^2\tan^2 \theta+h^2+Sh-Sw\tan \theta+2hw\tan \theta}}{\sec \theta}$$
$$x=-w\pm\frac{\sqrt{(w\tan \theta+h)^2+S(h+w\tan \theta)}}{\sec \theta}$$
$$x=-w\pm\frac{\sqrt{(w\tan \theta+h)(h+w\tan \theta+S)}}{\sec \theta}$$
That is,
[TABLE="width: 500"]
[TR]
[TD]$$x=-w+\frac{\sqrt{(w\tan \theta+h)(h+w\tan \theta+S)}}{\sec \theta}$$[/TD]
[TD]or[/TD]
[TD]$$x=-w-\frac{\sqrt{(w\tan \theta+h)(h+w\tan \theta+S)}}{\sec \theta}$$[/TD]
[/TR]
[/TABLE]
We can conclude that $$x=-w+\frac{\sqrt{(w\tan \theta+h)(h+w\tan \theta+S)}}{\sec \theta}$$ is the right answer (without needing to prove if this point generates the maximum value for $\beta$) because we can tell from the diagram that $-(x+w)<0$ and hence, you and your sweetheart should sit $$\frac{\sqrt{(w\tan \theta+h)(h+w\tan \theta+S)}}{\sec \theta}$$away from the screen in order to get the maximize viewing angle!:)