The answer by @NickCHK is very good and the derivation is correct for quantity taxes. Nevertheless, let me clarify a few things. In the comments you give a counterexample to this formula and state that the formula only holds for linear S or D. That is not true.
It also holds for non-linear S/D. Your counterexample about the supply shape is not only non-linear, it is also non-continuous. That means the derivative does not exist over the whole domain, which complicates things. Nevertheless, the formula would hold on either side of the kink points. Furthermore, your comment seems to argue that the formula implies constant incidence shares. This is also not true as elasticities are not necessarily constant with regards to quantity.
There is, however, a common case where this formula does not hold exactly. For ad valorem taxes (e.g. the VAT) you would have slightly different expressions. Nevertheless, the incidence formula for quantity taxes is still a good proxy. This is discussed a bit in Carbonnier (2007), who analyzes VAT, but uses the formula in your OP as a proxy for the consumer share of the tax.
It is also worth noting that the formula is derived for marginal tax rate changes. With very large changes, the incidence will not be exactly as described above, but that is a caveat of all such analysisanalyses using (non-discrete) derivatives.