$\int\frac{a\cos x+b}{(a+b\cos x)^2}dx=\;?$ 
Answer Given: $\frac{\sin x}{a\cos x+b}$.
My Answer: $\frac{\sin x}{a+b\cos x}$.

Method I Used:
I used this: $$\int\frac{f(x)}{[p(x)]^2}=\int\frac{f(x)}{p'(x)}.\frac{p'(x)}{[p(x)]^2}.$$ and applied integration by parts.
Working:
Complete working is too long, so I'll be writing main things.
$\int\frac{a\cos x+b}{b\sin x}.\frac{b\sin x}{(a+b\cos x)^2}dx.$
I applied integration by parts and took $\frac{a\cos x+b}{b\sin x}$ as first function.
The differentiation of first function I got was $\frac{-a-b\cos x}{b\sin^2x}$.
The integration of second function I got was $\frac{-1}{a+b\cos x}$.
I used these values and simplified and got a little different answer, mentioned above.
Also, I tried using different methods, like writing $\cos x$ in terms of $\tan(x/2)$ or breaking numerator into P(Denominator) + Q, where $P$ and $Q$ are constants, but they gave different answers.
Kindly Help.

Let $\displaystyle \mathcal{I} = \int\frac{a\cos x+b}{(a+b\cos x)^2}dx = \int \frac{(a+b\cos x)\cdot (\sin x)'-\sin x\cdot (a+b\cos x)'}{(a+b\cos x)^2}dx$
So $\displaystyle \mathcal{I} = \int \bigg(\frac{\sin x}{a+b\cos x}\bigg)'dx = \frac{\sin x}{a+b\cos x}+\mathcal{C}$
Alternate
Let $\displaystyle I = \int\frac{a\cos x+b}{(a+b\cos x)^2}dx = \int\frac{a\csc x\cot x+b\csc^2 x}{(a\csc x+b\cot x)^2}dx$
substitute $a\csc x+b\cot x = t$ and $(a\csc x\cot x+\csc^2 x)dx = -dt$
so $\displaystyle \mathcal{I} = -\int  t^{-2}dt = \frac{1}{t}+\mathcal{C} = \frac{\sin x}{a+b\cos x}+\mathcal{C}$
Alternate 
$\displaystyle I  = \int\frac{a\cos x+b(\cos^2 x+\sin^2 x)}{(a+b\cos x)^2}dx = \int\frac{\cos x}{(a+b\cos x)}dx+\int\frac{b\sin^2 x}{(a+b\cos x)^2}dx$
by parts for $(1)$
$\displaystyle I = \frac{\sin x}{a+b\cos x}-\int\frac{b\sin^2 x}{(a+b\cos^2 x)dx}+\int\frac{b\sin^2 x}{(a+b\cos^2 x)dx}=\frac{\sin x}{a+b\cos x}+\mathcal{C}$
