The principal amount is P, rate of interest is R and time of loan is T
When interest is not compounded annually but with a periodicity of "n", i.e. interest is incurred "n" times annually:
A = $$P\left(1+\frac{R}{n\cdot100}\right)^{n\cdot T}$$
For example, when the periodicity is 2, i.e. "n" = 2, the interest is compounded half-yearly:
A=$$P\left(1+\dfrac{R}{200}\right)^{2T}$$
and when the periodicity is 4, i.e. "n" = 4, the interest is compounded quarterly:
$$A = P\left(1+\dfrac{R}{400}\right)^{4T}$$
For 2 years:
$$CI - SI = P\left(\dfrac{R}{100}\right)^2$$
For 3 years:
$$CI - SI = P\left(\dfrac{R}{100}\right)^2\left(3+\dfrac{R}{100}\right)$$
If an amount 'P' is borrowed for 'n' years at r% per annum compounded annually, and x is the instalment that is paid at the end of each year, starting from the first year, then:
$$P\ =\ \dfrac{\ x}{1+\dfrac{r}{100}}+\ \dfrac{\ x}{\left(1+\dfrac{r}{100}\right)^{^2}}+...+\ \dfrac{\ x}{\left(1+\dfrac{r}{100}\right)^{^n}}$$
or
$$P\ \left(1+\frac{r}{100}\right)^{n\ }=\ x\ \left(\left(1+\frac{r}{100}\right)^{n-1}+\left(1+\frac{r}{100}\right)^{n-2\ }...\ +1\right)$$
The same formula can be used when a man purchased an article costing Rs P and decided to pay the amount in yearly instalments of Rs. X with an interest rate of r% per annum compounded annually over a time period of 'n' years.