According to the answer, the given problem is wrong.
The equation should be equated to 10 rather than 7.
The above equation is very different from the one that you were given.What I'm doing (More than likely wrong)
That last step is not valid. More generally, you have that in general .