Another explanation of "then Moses and the children of Israel chose to sing." This is to be understood in light of that, which is written "your lips drip honey,"
Moses said, "master of the world with the very word with which I sinned before you I now laud you"
Rabbi Levi Bar Chiya said" this can be compared to a province that rebelled against the king and the king said to his Duke, let us go and battle against that province.
The Duke replied to him, you are not capable of suppressing it.
The king kept silent and went at night by himself and conquered it. When the Duke became aware of the king's successful conquest, he made a crown and brought it to the king. The king asked him for what purpose is this crown, the Duke replied: Because I sinned in the matter of doubting your power and I said to you, you are not capable of suppressing the problem.
Similarly, Moses said before Hashem, "I know that I sinned before you with the word then" as it is stated "from then that I came to Pharoah"
Moses continued And now behold you have drowned Pharoah in the sea! Therefore, I now praise you with the word then
This is the import of that which is written in our verse "then Moses and the children of Israel chose to sing"
Come and see the way of the righteous precisely with that which they do wrong. They rectify their wrongdoing...
Go and deduce from that which God did at Marah that he showed Moses, a bitter thing, which Moses then through into the bitter water, and the water became sweet.
As it is stated. Moses cried out to Hashem and Hashem showed him a tree, he threw it into the water and the water became sweet.
What type of tree was it? ... in any case it was a bitter tree and it sweetened the bitter waters.
And similarly, Moses provoked God with none, other than the word then, and with that word with which he did wrong, he rectified his actions and uttered a song of praise beginning, then Moses and the children of Israel chose to sing.