By momentum conservation we can find the final velocity of two cars
[tex]m_1v_{1i} + m_2v_{2i} = m_1v_{1f} + m_2v_{2f}[/tex]
now we know that they combined together after collision and first car is at rest initially
[tex]m_2v_2 = (m_1 + m_2)v[/tex]
[tex]v = \frac{m_2v_2}{m_1 + m_2}[/tex]
now the kinetic energy of two combined cars is
[tex]KE = \frac{1}{2}(m_1 + m_2)(\frac{m_2v_2}{m_1+m_2})^2[/tex]
[tex]KE = \frac{1}{2}(\frac{m_2^2v_2^2}{m_1 + m_2})[/tex]