This function should also raise NonElementaryIntegralException, instead of returning None, which means that you should just remove these `try`, `except` blocks.