How to integrate question of types: int (asinx+bcosx)/(csinx+dcosx) dx where a,b,c, d are coefficients by several methods?

Apr 14, 2018

$I = \frac{\left(a c + b d\right) x + \left(b c - a d\right) \ln \left(\left\mid c \sin \left(x\right) + \mathrm{dc} o s \left(x\right) \right\mid\right)}{{c}^{2} + {d}^{2}} + C$

Explanation:

We want to solve

$I = \int \frac{a \sin \left(x\right) + b \cos \left(x\right)}{c \sin \left(x\right) + \mathrm{dc} o s \left(x\right)} \mathrm{dx}$

Notice the easier integrals

color(blue)(I_1=int(csin(x)+dcos(x))/(csin(x)+dcos(x))dx=x+C_1

color(blue)(I_2=int(c cos(x)-dsin(x))/(csin(x)+dcos(x))dx=ln(abs(csin(x)+dcos(x)))+C_2

Can we determinate some constants $A$ and $B$, such that

$I = A {I}_{1} + B {I}_{2}$

Then

$a \sin \left(x\right) + b \cos \left(x\right)$
$= A \left(c \sin \left(x\right) + \mathrm{dc} o s \left(x\right)\right) + B \left(c \cos \left(x\right) - \mathrm{ds} \in \left(x\right)\right)$

$\textcolor{red}{a} \sin \left(x\right) + \textcolor{g r e e n}{b} \cos \left(x\right) = \textcolor{red}{\left(A c - B d\right)} \sin \left(x\right) + \textcolor{g r e e n}{\left(A d + B c\right)} \cos \left(x\right)$

Solving for $A$ and $B$

$A = \frac{a c + b d}{{c}^{2} + {d}^{2}}$

$B = \frac{b c - a d}{{c}^{2} + {d}^{2}}$

Thus

$I = \frac{a c + b d}{{c}^{2} + {d}^{2}} {I}_{1} + \frac{b c - a d}{{c}^{2} + {d}^{2}} {I}_{2}$

$\textcolor{w h i t e}{I} = \frac{\left(a c + b d\right) {I}_{1} + \left(b c - a d\right) {I}_{2}}{{c}^{2} + {d}^{2}}$

$\textcolor{w h i t e}{I} = \frac{\left(a c + b d\right) x + \left(b c - a d\right) \ln \left(\left\mid c \sin \left(x\right) + \mathrm{dc} o s \left(x\right) \right\mid\right)}{{c}^{2} + {d}^{2}} + C$