Answer
There were 15 oranges initially.
There were 45 apples initially.
Hence, there were (15 + 45) = 60 fruits there initially.
Explanation
Let the number of oranges be x
Let the number of apples be y
The ratio of the number of oranges to the number of apples is 1 : 3 implies:
[tex]\begin{gathered} x\colon y=1\colon3 \\ \frac{x}{y}=\frac{1}{3} \\ \text{Cross multiply} \\ y\times1=x\times3 \\ y=3x----i \end{gathered}[/tex]If 21 oranges were added and the ratio became 4 : 5, this implies:
[tex]\begin{gathered} (x+21)\colon y=4\colon5 \\ \frac{x+21}{y}=\frac{4}{5} \\ \text{Cross multiply} \\ 5(x+21)=4\times y \\ 5x+105=4y----ii \end{gathered}[/tex]To know how many fruits were there initially, solve the system of the equations:
[tex]\begin{gathered} \text{Substitute }y=3x\text{ into }ii \\ 5x+105=4(3x) \\ 5x+105=12x \\ \text{Combine the like terms} \\ 12x-5x=105 \\ 7x=105 \\ \text{Divide both sides by 7} \\ \frac{7x}{7}=\frac{105}{7} \\ x=15 \end{gathered}[/tex]x = 15 implies there were 15 oranges initially.
To get y, substitute x = 15 into equation (i):
[tex]\begin{gathered} y=3x----i \\ y=3\times15 \\ y=45 \end{gathered}[/tex]y = 45 implies there were 45 apples initially.
Hence, there were (15 + 45) = 60 fruits there initially.