From what I can see on wikipedia, the parameters of Cobb-Douglas are the value of goods produced, labour, capital, "total factor productivity" (as I understand it, everything other than labour and capital that might contribute to productivity) and a couple of constants. For an AI to maximise the output of the function you'd have to somehow make it possible for it to manipulate those parameters- to hire or fire personel, to spend or acquire capital and to somehow manage all those unknown factors that might be contributing to the output.
The question is: how do you do that? You can certainly collect, or even auto-generate examples of the inputs and outputs of the functions, since we're just talking numerical parameters, and find a maximum of the function. But for an AI to actually improve the productivity of a business, it would have to do a lot more than that. It would need the ability to manipulate those parameters directly in the real world. Otherwise, all it would do is calculate a number. Which is not that very threatening.
You could specify a simpler goal like “increase economic output”, and an example might be something like optimizing the Cobb-Douglas production function. Even that very narrow goal in the context of say, manufacturing Teslas, would give me pause. Look up “instrumental convergence” to see why the above is a bad idea.