TITLE: Compound Interest Formula adding annual contributions
QUESTION [10 upvotes]: I'd like to know the compound interest formula for the following scenario:
P = Initial Amount
i = yearly interest rate
A = yearly contribution or deposit added.
n = the deposits will be made for 10 consecutive years.
F = final amount obtained.
I start with an initial amount and an yearly interest rate applied will be applied to it. Then, every year a contribution/deposit is made at the end of the period, that is, after the interest is applied to the previous amount.  No withdrawals are made.

REPLY [7 votes]: The final value $F=F'+F''$ is the sum of two components:

the initial deposit will produce after $n$ years at the interest rate $i$ the future value
$$F'=P(1+i)^n$$
the periodic payments are an annuity-immediate (made at the end of each contribution period) the future value is
$$
F''=A\,s_{\overline{n}|i}=A\frac{(1+i)^n-1}{i}
$$
Thus, the future value $F$ is
$$
F=P(1+i)^n+A\frac{(1+i)^n-1}{i}=\left(P+\frac{A}{i}\right)(1+i)^n-\frac{A}{i}
$$
If the additional payments are made at the beginning of each period the annuity is an annuity due and the future value is obtained multiplying by $(1+i) $, that is
$$
F''=A\frac{(1+i)^n-1}{i}(1+i)
$$
and then 
$$
F=P(1+i)^n+A\frac{(1+i)^n-1}{i}(1+i) =\left(P+\frac{A}{d}\right)(1+i)^n-\frac{A}{d}
$$
where $ d=\frac{i}{1+i} $ is the discount rate.