Observe that the units of
\(\$ /\text{widget}\) on the selling price and production cost are both rates of change of the form
\((\text{function output})/(\text{function input})\text{.}\) This, along with the fact that these rates are constant, indicates the function is likely a linear function. Going to the formula we get
\begin{equation*}
P = (\text{revenue}) - (\text{cost}) = 35q - (1000 + 15q).
\end{equation*}
This simplifies to the linear function
\begin{equation*}
P = 20q - 1000.
\end{equation*}
Here we see that
\(\$ 1000\) will be spent no matter how many widgets are sold, and we get a net profit of
\(\$ 20\) for each widget sold.