# Complicated integration problem

I need to figure this integral out for a graduate research project, however I've been stuck on it for days now:

int[ sqrt((R^2)+2*R*A*cos(T)+(A^2))*cos(atan(-(R+A*cos(T))/(A*sin(T)))-atan(-cot(T))) ]

*integration is with respect to T (all other variables can be assumed constant)

I have been looking around for anything that resembles this but with no luck. I have also tried integration by parts, using the square root as the 'dv' term however I haven't been able to figure out how to integrate the square root term on its own either. I've also tried using MATLAB to solve the integral for me, but MATLAB just stays 'busy' forever and never outputs anything. If anybody could help me out or point me in the right direction, it would be greatly appreciated.

$$\int \sqrt{R^2+2 R A \text{Cos}[T]+A^2}\text{Cos}\left[\text{ArcTan}\left[-\frac{R+A \text{Cos}[T]}{A\text{Sin}[T]}\right]-\text{ArcTan}[-\text{Cot}[T]]\right]dT\text{//}\text{Simplify}$$
$$=\frac{A \sqrt{\frac{\left(A^2+R^2+2 A R \text{Cos}[T]\right) \text{Csc}[T]^2}{A^2}} (A T+R \text{Sin}[T])}{\sqrt{A^2+R^2+2 A R \text{Cos}[T]} \sqrt{\text{Csc}[T]^2}}$$

Are you sure you wrote that down correctly? That answer cancels out to:

AT + Rsin(T)

Are you sure you wrote that down correctly? That answer cancels out to:
I just copied and pasted from Mathematica so i assume I did write it down correctly Maybe already your original expression cancels out to something quite easy if you use enough trig identities.

You were right, it does indeed work out to that once you figure out the trig identities. Wouldn't have figured it out without your help Callahan, I owe you one.