In economics and particularly in consumer choice theory, the substitution effect is one component of the effect of a change in the price of a good upon the amount of that good demanded by a consumer, the other being the income effect.
When a good's price decreases, if hypothetically the same consumption bundle were to be retained, income would be freed up which could be spent on a combination of more of each of the goods. Thus the new total consumption bundle chosen, compared to the old one, reflects both the effect of the changed relative prices of the two goods (one unit of one good can now be traded for a different quantity of the other good than before as the ratio of their prices has changed) and the effect of the freed-up income. The effect of the relative price change is called the substitution effect, while the effect due to income having been freed up is called the income effect.
If income is altered in response to the price change such that a new budget line is drawn passing through the old consumption bundle but with the slope determined by the new prices and the consumer's optimal choice is on this budget line, the resulting change in consumption is called the Slutsky substitution effect. The idea is that the consumer is given enough money to purchase her old bundle at the new prices, and her choice changes are seen.
If instead, a new budget line is found with the slope determined by the new prices but tangent to the indifference curve going through the old bundle, the difference between the new point of tangency and the old bundle is the Hicks substitution effect. The idea now is that the consumer is given just enough income to achieve her old utility at the new prices, and how her choice changes is seen. The Hicks substitution effect is illustrated in the next section.
Some authors refer to one of these two concepts as simply the substitution effect. The popular textbook by Varian  describes the Slutsky variant as the primary one, but also gives a good explanation of the distinction.
The same concepts also apply if the price of one good goes up instead of down, with the substitution effect reflecting the change in relative prices and the income effect reflecting the fact the income has been soaked up into additional spending on the retained units of the now-pricier good.
For example, consider coffee and tea. If the price of coffee increased, consumers of hot drinks may decide to start drinking tea instead. This will cause the demand for tea to increase. Likewise, if the price of coffee was to decrease, tea-drinkers may decide to shift their drinking habits and substitute coffee for their daily drinking habits, causing the demand for tea to decrease.
Economists had long understood that changes in price could lead to two main responses by consumers, initial work on this subject had been done by Vilfredo Pareto in the 1890s, but it wasn't until Eugen Slutsky’s 1915 article that rigor was brought to the subject. Slutsky’s original paper was published during World War I in Italian, because of this economists in the Anglo-American world did not become aware of Slutsky’s contributions until the 1930s. The English world was fully introduced to Slutsky's ideas in 1934 when "A Reconsideration of the Theory of Value" was published by John Hicks and RGD Allen, this paper built upon work by Pareto and came to conclusions Slutsky had realized two decades prior.
Suppose the initial situation is given by the graph (with good Y plotted horizontally) with the indicated (and never-changing) indifference curves shown and with budget constraint BC1 and with the consumer choosing point A because it puts him on the highest possible indifference curve consistent with BC1. The position and slope of the budget constraint are based on the consumer's income and on the prices of the two goods X and Y. If the price of Y falls, the budget constraint pivots to BC2, with a greater intercept of good Y because if all income were spent on Y more of it could be purchased at the now-lower price. The overall effect of the price change is that the consumer now chooses the consumption bundle at point C.
But the move from A to C can be decomposed into two parts. The substitution effect is the change that would occur if the consumer were required to remain on the original indifference curve; this is the move from A to B. The income effect is the simultaneous move from B to C that occurs because the lower price of one good in fact allows movement to a higher indifference curve. (In this graph Y is an inferior good since C is to the left of B so Y2 < Ys.)
The concept of the elasticity of substitution was developed by two different economists, each with their own focus. One of these economists was John Hicks, who defined elasticity of substitution as the change in percentage in the relative number of factors of production used, given a particular change in percentage in relative prices or marginal products. This definition is also known as the direct elasticity of substitution. The other economist was Joan Robinson, who defined elasticity of substitution as the change in proportion of the ratio of the number of factors used divided by the change in proportion of the ratio of each factor's prices. These two definitions function in the same way when limited to two factors of production.