However, investment in knowledge leads to increasing returns in marginal products. If your team of researchers designs a prototype for the perfect widget, your factories can produce them, and you will sell thousands of them for the cost of the one development which put you ahead of the competition. I've got a great example here, of a design problem which developed into a conceptual leap. They worked towards a machine with only 60 parts, ended up with 62, and a machine that could be assembled in 3-4 minutes. In other words, the development cost is high, but after that has been paid, the knowledge can be reproduced at very little cost.
Knowledge production has many side-benefits.
Once you know that something can be done, you can start trying to duplicate it. And new knowledge has a positive effect on the production possibilities of other firms. The Internet is a great example. It was developed by the US military to have no central controls, just in case the country needed to survive a nuclear attack. But endogenous growth doesn't just happen.