Let time taken to finish the race by car #A and B# be #= t_A and t_B# respectively.

We need to assume that cars start from rest and have respective acceleration #= a_1 and a_2#.

Using the kinematic equation

#s=ut+1/2at^2# we get

Race track #s =1/2 a_1t_A^2 #

Also #s=1/2 a_2t_B^2#

Equating the length of race track in case of both cars

#a_1t_A^2 = a_2t_B^2# ......… (1)

Also given is

#t_B= t_A+ t# ........... (2)

Using the kinematic equation

#v=u+at# we get velocity at the end of race for

car #A = a_1t_A and# for car #B = a_2 t_B#

Given is

#a_1t_A = a_2t_B + v# .....(3)

From this equation we need to eliminate #t_A and t_B# to get the desired expression. (3) can be rewritten as

#v= a_1t_A-a_2t_B#

Substituting value of #a_1# from (1)

#v= (a_2t_B^2)/t_A- a_2t_B#

#=>v= a_2(t_B/t_A)(t_B –t_A)#

Using (2) we get

#v= a_2 t (t_B/t_A)#

Using (1) we get

#v= a_2 tsqrt(a_1/a_2)#

Squaring both sides we get

#v^2= t^2a_1a_2#