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 kind of behaviour of the person or thing performing the action (for example saying that s/he or it acts quickly or with precision), 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) in order to name an enabling action, like this:
(a) The optimum price for a commodity can be found by constructing (by the construction of) a demand curve.
This use of by is not the same as the subject-showing one. Perhaps one indication of its difference is the fact that we could add another by phrase just before it – for example by economists – that we would immediately recognize as a more suitable subject of FIND in the active voice and hence the “real” cause of the action (for more on subjects, see 12. Singular and Plural Verb Choices). A further indication, perhaps, is the fact that the by phrase in (a) is grammatically replaceable by a standard adverb like easily.
By is also means-showing when used before the noun means in phrases like by all means, by every means (for the difference see 157. Tricky Word Contrasts 5, #6), and by means of.
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) *The optimum price for a commodity can be found by a demand curve.
This is a mistake because the by is doing neither of the things that it should do: the words after it (a demand curve) represent neither the author of the finding expressed by the passive verb nor a separate action/means. The mistake can be corrected either by converting a demand curve into an action (for example by adding constructing in front), or by using a different preposition – one that changes a demand curve from a means to an instrument (see below).
Another common error with means-showing by is using it as the subject of the sentence (e.g.*By working hard brings success). 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.
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 a demand curve, a struggle or a memory.
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 often found before them is by (without an article), as in by car, by train, by bicycle, by bus and by lorry (English differs here from Dutch, one of its closest relatives, which does 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. Referring to Data 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. Referring to Data 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. Countable Noun Meanings 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.