Optimization problem and measurements

This is more of math problem, but my doubt is about the measurement units of the final answer so I figured I'd post it here.

Problem:

A lighthouse is located on a small island 3 km away from a straight shoreline and its light makes 2 revolutions per minute. How fast is the beam of light moving along the shoreline when it is 2 km away from the nearest point to the lighthouse.

Solution:

Let $x$ be distance between the beam and the nearest point and $\theta$ the angle between the line that goes from the lighthouse to nearest point and the one that goes to where the beam is on the shoreline. We know that $\frac{d\theta}{dt} = \frac{\pi}{30}$ radians per second and that $\tan(\theta)=\frac{x}{3}$. We need to find $\frac{dx}{dt}$. Thus

\begin{align*} x &= 3\tan(\theta)\\ \frac{dx}{dt} &= 3\frac{d}{dt}\tan(\theta)\\ &= 3\sec^2(\theta)\frac{d\theta}{dt}\\ &= 3(\tan^2(\theta)+1)\frac{\pi}{30}\\ &= (\frac{x^2}{9}+1)\frac{\pi}{10}\\ \end{align*}

And if we plug for $x=2$ we get $\frac{13\pi}{90}$.

Question:

What is the measurement units of the answer? I thought it should be kilometers per second, because it is only type of answer that makes sense, but how does it follow from the steps in the solution?

• This question does seem more appropriate for Math Stack Exchange, so I voted to migrate. – heather May 31 '17 at 13:19
• We don't answer homework-like questions that show no effort, because it is not good for people to look up homework answers. They should learn to do their own thinking. So what is our policy when the original poster provides a worked answer? It seems to create the same problem. – mmesser314 May 31 '17 at 13:42
• We're harsh on homework questions --- with rapid closure and a strong discouragement against complete answers --- because there are students who will copy-paste a homework assignment into our question block, wait for the notification that someone has solved it, and steal that solution without having really transferred any physics information. That's what we are trying to avoid when we say "[physics] isn't a homework help service." This question is pretty much the opposite: the algebra is done, correctly, and we have a conceptual question about how to keep track of the units. I think it's fine. – rob May 31 '17 at 15:44

HINT: this is why it's always good to carry the units along throughout your derivation. Try starting the derivation by writing $$x = (3 \text{ km}) \tan(\theta)$$ and note that the units of $d \theta/dt$ when you plug it in are radians per second, which you can write as $\text{s}^{-1}$. (If you're unclear on why this is, see this question.) Once you've done this, the way the units cancel & combine should become clearer.
Your question could be asked like this. I have position as a function of time, $y = x(t)$, where x is in meters, and t in seconds. I can take the derivative to get velocity, $v = dy/dx$. How do I get the right units? If $y = 3t$, I get $v = 3$, not $v = 3 m/s$
The answer is in the definition of the derivative. It is the limit of $\Delta x/\Delta t$ as $\Delta t \to 0$. So the units come out the same as if you had divided.