I don't know about this particular case though, I get the feeling there's a system to it that can be exploited by eg Wolfram. It's just that you're in the dark for a long time before you find the switch.
Your intuition is right. There is a general algorithm for finding the antiderivatives: https://en.wikipedia.org/wiki/Risch_algorithm Its simplified form can solve pretty much all the undergrad antiderivation problems.
I'm a math major, but I consider the time spent learning the tricks for antiderivation to be kinda useless.
It doesn't. But if there is an elementary antiderivative, the Risch algorithm will find it (given the caveats listed in the Wikipedia article). But it might require a lot of substitutions, making its manual application impractical.
Another caveat is that Risch algorithm applies only to antiderivatives, not to the definite integrals. Some definite integrals can be computed without finding the antiderivative, often with the help of Feynman's trick.
“Perhaps I could best describe my experience of doing mathematics in terms of entering a dark mansion. One goes into the first room, and it’s dark, completely dark. One stumbles around bumping into the furniture, and gradually, you learn where each piece of furniture is, and finally, after six months or so, you find the light switch. You turn it on, and suddenly, it’s all illuminated. You can see exactly where you were.” - Andrew Wiles