Finding minimum without using calculus Is it possible to find the minimum value of 
$$\frac 1{\cos\theta}\big(k-\sin\theta\big)$$
and the value of variable $\theta$ at which this occurs, 
where $0\le \theta\le \arctan(q)$,  and $k>1$  without using calculus, but only by rearranging terms, similar to completing the square for finding the maximum/minimum of a quadratic?
 A: Let us consider the unconstrained problem first. The Cauchy-Schwarz inequality gives that
$$-\sqrt{1+m^2}\leq \sin\theta + m\cos\theta \leq \sqrt{1+m^2} $$
and both the inequalities holds as equalities for specific values of $\theta$, related to $\arctan\frac{1}{m}$. Let us assume that
$$ k-\sin\theta = m\cos\theta $$
holds for some $\theta$, but $k-\sin\theta = (m-\varepsilon)\cos\theta$ does not hold for any $\theta$ ($\varepsilon$ is assumed to be an arbitrarily small, but positive quantity). We are actually assuming that $m$ is the minimum of $\frac{k-\sin\theta}{\cos\theta}$. Since $k=\sin\theta+m\cos\theta$ holds for some $\theta$, $k\in[-\sqrt{1+m^2},\sqrt{1+m^2}]$, so $k^2\in(1,m^2+1]$ and $|m|\leq\sqrt{k^2-1}$. Since $k=\sin\theta+(m-\varepsilon)\cos\theta$ does not hold for any $\theta$, $k^2< 1+(m-\varepsilon)^2$. $m$ is trivially negative, so $m=-\sqrt{k^2-1}$.
The constrained problem can be tackled in the same way: it is enough to consider the range of $f(\theta)=\sin\theta+m\cos\theta$ for $0\leq \theta\leq \arctan(q)$. Since $m$ is negative the function $f(\theta)$ is increasing on $[0,\arctan q]$, so its range is $[f(0),f(\arctan q)]=\left[m,\frac{q+m}{\sqrt{q^2+1}}\right]$
