Suppose I built a machine that, in any given hour, produces one unit
of penicillin and one unit of randomly mixed chemicals (from the same
raw materials). Does this mean that penicillin and mixed chemicals
should have equal value?
That's an interesting issue, which we could call the question of by-products. It isn't, that I know, directly addressed by Marx, but I think we can logically deduce an answer to it from his other points.
If a given production process results in two different products, then the total value of both products is given by the total labour time embodied in both of them.
We could then make the following hypothesis:
- One of the products has a use value, the other has not.
- Both products have a use value.
If 1., then the value of the product that has a use value is the total value produced.
If 2., then the total value of the production process is spread among both products. In terms of price, this does not mean that they each must have the same price - price gravitates around value but is not determined by it. In practice, the prices are given by supply and demand.
Let's suppose that in a given society, it is usual to consume bread without the crust. So the crust has no use value; only the crumb is useful, only the crumb is sold. Its price gravitates around the value of the whole productive process, which, in the case, besides the usual mixing and baking, includes the cutting away of the crust (and so, it is more expensive than the bread as a whole, crust included). A baker can sell his bread cheaper if he sells it with the crust, thus "outsourcing" the task of cutting the crust off to the consumer - as long as the consumers recognise this whole bread as a use value of itself.
If on the other hand the baker does the cutting himself, he ends with up with two products: a commodity - the bread crumb - and waste - the crust.
Suppose now that the baker discovers that there is a demand - ie, a use value - for the crust (he can sell it to pigherds, who feed their pigs on bread crust, for instance). In this case, he now has two commodities at the end of his productive process. That is, the labour that it takes to produce one is the same labour that it takes to produce both. Their total value is the total value of the whole productive process.
The baker can now sell his crustless bread for a lower price than previously, because he can realise some of the value by selling the crust apart, to different costumers. Obviously, as long as this remains his commercial secret, he may instead make superprofits: he sells his crustless bread for the same price as before, and sells the crust for any price he finds pigherds eager to buy it. This doesn't mean that he is producing more value, but that he is engaging in unequal exchanges, giving away less value than he is getting for it in exchange.
But this would be an exceptional situation: with time, other bakers will realise they can do the same thing; at this point, the market will bring the total prices of both commodities to the same level as the former price of the previously sole commodity. The proportion between the prices of each commodity, however, cannot be explained by labour embodied in each of them, for it is the same labour. They will be fixed by supply and demand considerations, which in turn rely on other productive processes - that of producing pork, regarding the sale of crust, that of re-producing labour power, regarding the sale of the crumb.
So, back to your example of penicilin and mixed chemicals, it depends on whether there is a use for mixed chemicals or not. If not, all the value of this productive process is embodied in penicilin. If yes, then the value of both penicilin and the other chemicals is the "same", not as in "equal", but as in "inseparable", and will be distributed among the price of both commodities, not in proportion to necessary labour, but in proportion to market considerations.