Is there any mathematical argument for building ships a certain size (Ex: Should I put 6 lasers on this ship, or 7?), either in relation to the function of part of the game, or in relation to your other ships?
It's hard to say, but there are economies of scale for bigger ships, but increased diversity (and small efficiency and threshold improvements) when you make smaller ships too.
For instance, large fast ships can mount maximum size engines, hugely improving it's range, but need shipyards of appropriate size, maintnence facilities of appropriate size, but are much bigger blips on most radars, and have less ship-based redundancy.
Fighters on the other hand, are extremely fuel inefficient for mission tonnage, but can have fire controls of truly extreme speeds, can be built and scrapped easily via fighter factories. Due to the fighter factory dynamic, it is very easy to build new fighters for specific and niche purposes (where applicable), or easily upgraded with new technology in the sense that you just scrap old ones, build new ones.
It's hard to pin down when it's best to do something, as it's all very situational. A good way to find your "choice efficiency" though is a rather interesting doctrine: mission tonnage ratios. Basically, design your purpose-made ships to have a specific percentage of engine, ordnance, fuel, defenses, etc, and adjust them when your selected percentages aren't putting out satisfying results for your tech level. It'll make ship design a bit less... Scattered, to say the least.