In chess problems, retrograde analysis is a technique employed to determine which moves were played leading up to a given position. While this technique is rarely needed for solving ordinary chess problems, there is a whole subgenre of chess problems in which it is an important part; such problems are known as retros.
Retros may ask, for example, for a mate in two, but the main puzzle is in explaining the history of the position. This may be important to determine, for example, if castling is disallowed or an en passant pawn capture is possible. Other problems may ask specific questions relating to the history of the position such as "is the bishop on c1 promoted?". This is essentially a matter of logical reasoning, with high appeal for puzzle enthusiasts.
Sometimes it is necessary to determine if a particular position is legal, with "legal" meaning that it could be reached by a series of legal moves, no matter how bad. Another important branch of retrograde analysis problems is proof game problems.
An example of a retrograde analysis problem is shown on the left. The solver must deduce White's last move. It is not immediately apparent how the white king could have moved, since every adjacent square puts White in a seemingly impossible double check; on further examination it becomes apparent that if the white king moved from f5, then Black could have delivered the double check by playing f4xg3, capturing the white pawn on g4 en passant. Therefore, on the previous move, white must have played pawn g2-g4. But what did Black move before that? The white king on f5 was under check by the bishop on h3 and there was a white pawn on g2. The only possibility is that Black moved a knight from g4 to e5 with discovered check. Therefore, White's last move was king on f5 takes knight on e5. (The entire sequence of moves is 1...Ng4-e5+ (possibly capturing something on e5) 2.g2-g4 f4xg3+ e.p. 3.Kf5xe5.)
In this example the fact that Black can deliver mate in several different ways is irrelevant; likewise the fact that White could legally have captured the black queen by gxf3 on an earlier move is irrelevant. The solver is required only to deduce a legal sequence of moves which lead to the position, regardless of any considerations of chess strategy.
In retrograde analysis problems, as well as in standard chess problems, castling is assumed to be legal unless it can be proved otherwise. An en passant capture, on the other hand, is permitted only if it can be proved that the last move was a double step of the pawn to be captured. These two conventions lead to features unique to retrograde analysis problems.