20 seconds
Explanation:
Let [tex]x_a[/tex] be the distance traveled by the accelerating car and [tex]x_c[/tex] be the distance traveled by the car moving with a constant velocity. When they cover the same distance, we can write
[tex]x_a = x_c \Rightarrow v_{0a}t + \frac{1}{2}at^2 = v_ct[/tex]
where [tex]v_c[/tex] is the velocity of car moving at a constant rate and a is the acceleration of the accelerating car. Since the accelerating car started from rest, then [tex]v_{0a}[/tex] is zero so our equation above simplifies to
[tex]\frac{1}{2}at^2 = v_ct[/tex]
Note that the variable t cancels out so solving for t, we get
[tex]\frac{1}{2}at = v_c \Rightarrow t = \dfrac{2v_c}{a}[/tex]
Plugging in the given values,
[tex]t = \dfrac{2(20\:\text{m/s})}{2\:\text{m/s}^2} = 20\:\text{s}[/tex]