I understand that my question is probably too basic:
We have the nonlinear system:
System 1
$\dot{x_{1}} = 2x_{2} - \sin x_{1}$
$\dot{x_{2}} = x_{1}^{2} - x_{2}$
I tried to create the second order ode just for $x_{1}$ :
$\ddot{x_{1}} = 2x_{1}^{2} -\dot{x_{1}} -\sin x_{1} - \dot{x_{1}}\cos x_{1}$
in order to transform it as follows:
System 2
$\dot{x_{1}} = x_{2}$
$\dot{x_{2}} = 2x_{1}^{2} - x_{2}- \sin x_{1}- x_{2}cos x_{1}$
After plotting ($x_{1},x_{2}$) for both of them on Matlab I see the results are different, which means that the two systems, are not equivqlent as I was assuming.
Could you explain why the assumption was wrong?

(Just re-working for completeness): you have \begin{align*} \dot{x}_1 &= 2x_2 - \sin(x_1)\\ \dot{x}_2 &= x_1^2 - x_2. \end{align*} Rearranging the first equation yields $$x_2=\frac{\dot{x}_1+\sin(x_1)}{2}, $$ and differentiating yields $$\dot{x}_2=\frac12\left(\ddot{x}_1+\cos(x_1)\,\dot{x}_1\right). $$ Then we can write the second equation as \begin{align*} \frac12\left(\ddot{x}_1+\cos(x_1)\,\dot{x}_1\right)&=x_1^2-\frac{\dot{x}_1+\sin(x_1)}{2}\\ \ddot{x}_1+\cos(x_1)\,\dot{x}_1&=2x_1^2-\dot{x}_1-\sin(x_1)\\ \ddot{x}_1&=2x_1^2-\dot{x}_1-\cos(x_1)\,\dot{x}_1-\sin(x_1). \end{align*} So your initial elimination of $x_2$ is correct. However, if you simply write $\dot{x}_1=x_2,$ you've now re-defined $x_2$ compared with what it was before. That is not legal! You need to write $x_2$ using one of the equations you were given, such as $\dot{x}_2=x_1^2-x_2,$ or $x_2=(\dot{x}_1+\sin(x_1))/2.$
Here's a trick that might be helpful: \begin{align*} \dot{x}_2+x_2&=x_1^2\\ e^t\dot{x}_2+e^tx_2&=e^tx_1^2\\ \frac{d}{dt}\left(e^t\,x_2\right)&=e^tx_1^2\\ e^t\,x_2&=\int e^tx_1^2\,dt\\ x_2&=e^{-t}\int e^tx_1^2\,dt. \end{align*}