There isn't really such a thing as cheating in solving math problems, but there's such a thing as cheating in courses, and those are two different things.
What you describe is not cheating unless there are constraints you haven't told us about (e.g. it's during a closed-book exam).
In a perfect world, or in a better world, there would be more emphasis on solving problems that you haven't been told how to solve. I.e. you'd have been given enough information to figure it out if you put your brain in gear, but instead of resembling problems you've seen in the book, it might simply be a problem that relies on understanding of concepts you've seen in the book. In that case, you'd still want to look at the book.