find optimized height Please help me with this word problem:

A light is to be placed directly above the center of a circular plot of $r=30\text{ ft}$, at such a height that the edge of the plot will get maximum illumination. Find the height if the intensity $I$ at any point on the edge is directly proportional to the cosine of the angle of incidence and inversely proportional to the square of the distance from the source.

So far I think I set up the equation like so:
$$I = \frac{\cos\theta}{h^2}$$
Where $h$ is the distance from the source. I assume we must use some inverse trig identities and then take derivative wrt to $h$, and set to zero to find the critical numbers. But my expression has $3$ variables which I don't know how to take the derivative? It seems I'm missing a conceptual step. Please help. Thanks!
 A: Let $h$ be the height, $d$ the distance and $r$ the radius. The cosine of the angle of incidence is equal to $h/d$. Thus, intensity is proportional to $h/d^3$. Since $d=\sqrt{h^2+r^2}$, we get that intensity is proportional to $$\frac{h}{\sqrt{(h^2+r^2)^3}}$$
The derivative of this function is $$\frac{r^2-2h^2}{\sqrt{(r^2+h^2)^5}}$$ which is equal to zero when $h=\sqrt{r^2/2}$. Thus, for $r=30$, we get $h=\sqrt{900/2}=30/\sqrt{2}\approx21.2\, ft$.
The corresponding angle of incidence is $\arctan(\sqrt{2})\approx0.955$ radians, corresponding to $\approx54.7$ degrees.
Note that you could obtain the same results by calling $\alpha$ the angle of incidence and by observing that the distance is equal to $r/\sin(\alpha)$. Thus, intensity is proportional to $\cos(\alpha)\sin^2(\alpha)/r^2$. The derivative is $$\frac{2\sin(\alpha)-3\sin^3(\alpha)}{r^2}$$
which equals zero for $2-3\sin^2(\alpha)=0$, and then $\sin(\alpha)=\sqrt{2/3}$. Because this also implies $\cos(\alpha)=\sqrt{1-2/3}=\sqrt{1/3}$, we finally get $\tan(\alpha)=\sqrt{2}$, and then $\alpha=\arctan(\sqrt{2})$.
