A=P(1+r)t
A is the amount you end up with (this is the Principal plus the Interest) = 400,000
P is the Principal (or how much you start investing with) we will compute
r is the rate as a decimal = .06
t is the time in years= 30
400,000 = P (1+.06)30
400,000=P (1.06)30
Divide both sides by (1.06)30
P=69644.05
To calculate the Interest earned we subtract the A minus P
400,000 - 69644.05=$330,355.95