On a several decades/century scale it's worthwhile to funnel at least a few percent of GDP into basic science research[1]. But, in any given quarter/year, it's almost certainly a net loss. The trick being that every few decades, you'll get nuclear power, the transistor, etc[2].
Or, as a 'local' example: non-trivial number theory had basically no benefit for centuries but humanity kept 'investing' resources into it - which a short term optimizer wouldn't. Then, cryptography came along and it suddenly 'paid' for the entire field a dozen times over.
[1]: Research is sort of like early stage VC - but with funds that pay out over 70 years instead of ~7.
[2]: I would love to write about many more examples in much more depth, but will omit for the sake of brevity. I roughly feel like the newtonian mechanics was directly responsible for the industrial revolution, relativistic physics for the nuclear age, quantum mechanics for the computer age (with similar analogues in the biological sciences).
That said -- these didn't happen all at once. And every technological upheaval, no matter how large it has been in itself, has still appeared in the larger context to be only an incremental improvement.
Or to continue the calculus analogy, you divide your spending on growth between spending that increases the first derivative and second derivative of value. The former is current short term growth, but the latter may lead to more growth in the long term.