Use “by” before an action that facilitates another action, and “with” before a facilitating tool
MEANINGS OF “SAYING HOW”
To say how something is done is to name what helps the doing to take place. However, we can focus on different types of help: the person or thing performing the action (for example saying that s/he or it acts quickly or with care), or another action that has to be carried out to facilitate the one in question, or some tool(s) or equipment used. In grammar these three meanings are often called “manner”, “means” and “instrument” (see 101. Add-On Participles and 120. Six Things to Know about Adverbs).
Each of these different meanings of “how” can be expressed with its own typical preposition. Manner is also commonly expressed with adverbs or participles, and within this blog is examined in detail in the posts 85. Preposition Phrases and Corresponding Adverbs and 101. Add-On Participles. The focus here is on means and instrument. Means typically involves by, instrument with. However, sometimes other prepositions are needed instead. The challenge for learners of English is not to mix up the typical means and instrument prepositions, not to confuse the different uses of by, and not to use by or with when a non-standard preposition is needed.
USE OF “by” TO SHOW A MEANS
The preposition by of course has many uses apart from means-showing. Vocabulary-like meanings are found in such expressions as by December (= “up to and including”) and by the entrance (= “at the side of”). A familiar grammar-like meaning is the one associated with passive verbs (as well as some nouns − see 49. Prepositions after Action Nouns 2), meaning something like “through the work of” and showing that the noun after the preposition would be a “subject” if the verb were active instead of passive.
The meaning of “means” typically exists when by is placed directly before an -ing verb (see 70. Gerunds) or equivalent noun (see 131. Uses of “Action” Nouns), which of course express the enabling action that needs to be present in a means statement. Here is an example:
(a) One may find the optimum price for a commodity by constructing (by the construction of) a demand curve.
It is also possible to use by means of instead of by alone, but only without a following action word (… by means of a demand curve above). This is an acceptable alternative because by means of includes the idea of doing something within it (see also the discussion of by every means in 157. Tricky Word Contrasts 5, #6).
A common mistake made with means-showing by by writers whose mother tongue is not English is leaving out the action word, like this:
(b) *One can find the optimum price for a commodity by a demand curve.
This is a mistake because the by is doing neither of the things that it should do: it is showing neither the originator of the action of a passive verb nor an action/means. The mistake can be corrected either by adding an action word like constructing or by changing by into by means of.
Another common error with means-showing by is using it as the subject of the sentence (e.g.*By constructing a demand curve can …). This breaks the rule that subjects cannot have a preposition in front of them (see 84. Seven Things to Know about Prepositions). Means verbs can be the subject of another verb simply by having -ing without by.
Finally, note that English uses the preposition in, not by, before way meaning “means” (see 111. Words with their Own Preposition). For example, it is normal to say in many ways or in a particular way.
The preposition with is an especially common way of introducing an instrumental noun. Nouns of this kind will tend to be the names of tools – things that living beings, usually humans, use to carry out actions – so that with will generally mean the same as using. Tools are often concrete objects, such as hammers, but they can also be more abstract, like strength, determination or a demand curve. This means that changing by in (b) above to with is another possible correction – although the meaning changes too: from “means” to “instrument”.
Unfortunately, the preposition with is not the only one that can introduce an instrument. Alternatives seem to depend on the type and/or size of tool involved. It is arguable that transport modes are tools; the preposition they often have is by (without an article), as in by car, by train, by bicycle, by bus and by lorry (interestingly, Dutch, one of the closest relatives of English, actually seems to use a word meaning with in such cases). However, if you add an article before the noun, you usually have to say on or in instead of by: on a train, on a bicycle, on a bus and (usually) in a lorry and in/on an aeroplane.
Another exception to the with rule is with container nouns, such as a refrigerator, a drawer and a house. The normal instrumental preposition here is in (unless the use is an unexpected, non-containing one, like wedging). This use extends even to containers of a more metaphorical kind, such as diagrams, tables and photographs (see 104. Naming Data Sources with “As” and 111. Words with their Own Preposition). Even the use of in with some transport modes could be viewed as a subdivision of the containing use. Also worth mentioning is the fact that larger non-containing tools, such as a screen, a gas cooker and a table, seem often to prefer on, as do the data locations a page and a map.
CASES WHERE “with” AND “by” ARE BOTH CORRECT
Some nouns that can correctly follow with (or its alternatives) are also correct with by – though this will usually be subject-showing by rather than the means-showing one. Consider this:
(c) The liberated gas is collected … a gas jar.
It is possible to use by here, suggesting that a gas jar would be the subject if the passive verb is collected were active. It would mean that all responsibility for collecting the gas belonged to the gas jar rather than to any human. On the other hand, in is also possible, suggesting that the gas jar is only a tool used by a human being for collecting the gas. The existence of these different meanings can be confirmed by rewriting the sentence with a gas jar at the start as subject. The by meaning results in The gas jar collects …, while the in meaning produces The gas jar is used (in order) to collect. For more on this kind of contrast, see 104. Naming Data Sources with “As”.
The other use of by (means-showing) can also be replaced by with or equivalent in some contexts:
(d) (MEANS) Firms may motivate their workers by (the) introduction of new practices.
(e) (INSTRUMENT) A speaker can motivate the audience with a well-constructed introduction.
This sort of change is possible with “action” nouns that have an alternative non-action meaning, usually with different countability (see 14. Noun Countability Clues 1: Action Outcomes). In (d) introduction is uncountable (it would be strange to add an before it), and hence has an action meaning, equivalent to “introducing”, with the result that it expresses a means and needs by. In (e), on the other hand, a … introduction is countable, meaning something like “A first part”, and hence must be an instrument and take with.