A derivation of how to use implicit differentiation in reverse-mode AD (forward-mode is similar) to compute adjoints for a generic solver. Shows how to use vector Jacobian products for efficient calculation. Ends with a simple example of how you could implement in Julia (or in another language).