We devise a new algorithm, called the linear response algorithm, for differentiating SRB measures with respect to system parameters, where SRB measures are fractal limiting stationary measures of chaotic systems. The algorithm is illustrated on an example which is difficult for previous algorithms.The algorithm works for chaos on general manifolds with any unstable dimension, u. The algorithm is efficient and robust: its main cost is solving u many first-order and second-order tangent equations, and it does not compute oblique projections. The convergence to the true derivative is proved for uniform hyperbolic systems.The core of our algorithm is the first numerical treatment of the unstable divergence, a central object in the linear response theory for fractal attractors. We give a new characterization that the unstable divergence can be expressed by the solution of a renormalized second-order tangent equation, whose second derivative is taken in a modified shadowing direction, computed by the non-intrusive shadowing algorithm.