If you have any textbook with a chapter or two on integration, you will find a list related things, practically a family of them, there.
In this family it is quite common to have integrations that work only within certain range of x, a different formula outside it. This can correspond to something physical such as existence of escape velocity or runaway reaction outside the ‘tame’ region.
Not everybody does it this way but I recommend to change the variable so as not to have the constant ##a## within the formula to be integrated, e.g let ##x = 5aX##, a new variable . That way you can get integrands that are more recognisable and reduced to a smaller standard set. (You cannot forget this original ##a##, especially when you also have to change the ##dx## and also at the end of the calculation .)
There are then various ways, but I think what you were doing looks unnecessarily complicated than the simplest approach is just a further change of variable defining a ##y = sin X##
As things like this do not usually come out of the blue, I wonder if this reminds you of anything in that lesson or book?