This is a physics problem that involves an inelastic collision and a system of equations that I want to solve. I know the values of $v_1,m_1,v',\Delta E$ where $v'$ is the velocity of the two objects after they stick together. I want to solve the equations for either $m_2$(only in terms of $v_1,v',m_1, \Delta E$) or for $v_2$ (only in terms of ($v_1,v',m_1, \Delta E$) but I am stuck because the terms get very messy.
$$m_1v_1+m_2v_2=(m_1+m_2)v' \tag{1}$$
$$\frac{1}{2}m_1v_1^2+\frac{1}{2}m_2v_2^2=\frac{1}{2}m_1(v')^2+\frac{1}{2}m_2(v')^2+\Delta E \tag{2}$$
My attempt so far:
Solving$(1)$ for $v_2$:
$$\implies v_2=\frac{m_1}{m_2}(v'-v_1)+v' \tag{1a}$$
Plug $(1a)$ into $(2)$:
$$\implies \frac{1}{2}m_1v_1^2+\frac{1}{2}m_2(\frac{m_1}{m_2}(v'-v_1)+v')^2=\frac{1}{2}m_1(v')^2+\frac{1}{2}m_2(v')^2+\Delta E \\ \iff \frac{1}{2}m_1v_1^2+\frac{1}{2}m_2 \left[\frac{m_1^2}{m_2^2 }(v'-v_1)^2+2\frac{m_1}{m_2}v'(v'-v_1)+(v')^2 \right]=\frac{1}{2}m_1(v')^2+\frac{1}{2}m_2(v')^2 +\Delta E\\ \iff \frac{1}{2}m_1v_1^2+\frac{1}{2} m_2\left[ \left( \frac{m_1}{m_2}\right)^2((v')^2-2v'v_1-v_1^2)+2\left( \frac{m_1}{m_2}\right )((v'^2)-v_1v')+(v')^2\right] \\=\frac{1}{2}m_1(v')^2+\frac{1}{2}m_2(v')^2+\Delta E \\ \iff ...?$$
Is there an easier way to do this? How do I even continue?
\begin{align} m_1v_1+m_2v_2&=(m_1+m_2)v' \tag{1}\label{1} ,\\ \frac{1}{2}m_1v_1^2+\frac{1}{2}m_2v_2^2 &= \frac{1}{2}m_1(v')^2+\frac{1}{2}m_2(v')^2+\Delta E \tag{2}\label{2} . \end{align}
\begin{align} \eqref{1}:\quad m_2(v_2-v')&= m_1(v'-v_1) \tag{3}\label{3} ,\\ \eqref{2}:\quad m_2(v_2^2-v'^2)&= m_1(v'^2-v_1^2)+2\Delta E \tag{4}\label{4} . \end{align}
\eqref{3}$\times (v_2+v')-$\eqref{4}$\quad\Rightarrow$
\begin{align} 0&= m_1(v'-v_1)(v_2+v')-(m_1(v'^2-v_1^2)+2\Delta E) \tag{5}\label{5} ,\\ \end{align}
\begin{align} v_2 &= v_1+\frac{2\Delta E}{m_1(v'-v_1)} \tag{6}\label{6} . \end{align}