Theory:

Let us assume Rohit deposited a sum of \(₹\)40000 in a bank for \(2\) years at an interest of 7\(\%\) compounded annually. Then we will find out the Compound Interest \((C.I)\) and the amount she has to pay at the end of \(2\) years in a couple of steps.
To determine the compound interest for \(2\) years, first find out the simple interest for one year using principal and rate. Then find the amount for one year.
 
Then this amount will be the principal for next year.
 
Then again calculate the simple interest and amount. Then if you add the interest of both years we can find out the compound interest.
Step 1)
 
First we have to calculate the interest year by year. And we already studied to calculate the simple interest, that is:
 
I1=P1×n×r100
 
Here the principal \(P1\) \(= ₹\)40000
 
The time period  \(n\) \(=\)\(1\) years.
 
The rate of interest \(r\) \(=\)7\(\%\)
 
Substitute the known values in the formula we will get:
 
I2 \(=\) 40000×1×7100 \(=\) 2800
 
Step 2)
 
Then find the amount which will be received end of the year. This becomes principal for the next year.
 
Amount at the end of \(1\)st year \(=\) Principal of first year \(+\) Interest of first year 
  
 \(=\) 2800+40000
 
\(= ₹\)42800.
 
Amount at the end of \(1\)st year \(= ₹\) 42800 \(=\) \(P2\) [Which is principal for \(2\)nd year]
 
Step 3)
 
Again find the interest on this sum for another year \(=\) I2=P2×n×r100
 
Simple interest at  7 \(\%\) for second year \(=\) 42800×1×7100 \(= ₹\)2996.
 
Step 4)
 
Find the amount which has to be paid or received at the end of second year.
 
Amount at the end of \(2\)nd year \(=\) Principal P1 \(+\) Interest of second year
  
 \(=\) 42800+2996
 
\(=\) 45796.
 
Now we know the interest for both years therefore the total interest received is:
 
\(=\) Interest of first year \(+\) Interest of second year
  
 \(=\) 2800+2996
 
\(= ₹\) 5796.
 
So this \(= ₹\) 5796 is called as compound interest.
 
We can also find this compound interest in other way too that is:
 
Compound interest \(C.I =\) Final amount A2 \(–\) Initial principal P1.
 
C.I=4579640000C.I=5796
And do you think is there will be any difference in rupees between the simple and compound interest? Let's find out that too.
Simple interest for \(2\) years with rate of  7 \(\%\) and principal is  \(= ₹\) 40000.
 
\(I =\)I1=P1×n×r100
 
\(=\) 40000×2×7100
 
\(= ₹\)5600.
 
Now we can find the difference between the simple interest and compound interst that:
 
\(S.I\) after \(2\) years with rate of 7\(\%\) \(= ₹\)5600.
 
\(C.I\) after \(2\) years with rate of 7\(\%\) \(= ₹\)5796.
 
It is evidently shows that compound interest is much higher than the simple interest.