Hi

Your problem is the same as solving this integral

In your problem the discriminant is negative if and positive if

This integral can be solved by parts and then by rearranging a little bit into

The last integral depends by the sign of the discriminant

If negative then you can chose the proper change of variables to get (1+u²) at the denominator, and then integrate into arctan

If positive then you can factor the denominator into 2a²(x-x0)(x-x1) and go further in the decomposition of the last integral