How do we derive the formula for recurring deposit interest?

How do we derive the formula for recurring deposit interest?