$$\int \frac{1}{1+\tan x}dx,$$
A substitution like $t = \tan x, \;dt = (1+t^2)dx$ etc. immediately comes to mind, but I find this method a bit lengthy with the partial fractions. Is there a more concise solution to this?
$$\int \frac{1}{1+\tan x}dx,$$
A substitution like $t = \tan x, \;dt = (1+t^2)dx$ etc. immediately comes to mind, but I find this method a bit lengthy with the partial fractions. Is there a more concise solution to this?
On
Generalization:
For $\int\dfrac{a\cos x+b\sin x}{c\sin x+d\cos x}dx,$ where at least one of $a,b$ is non-zero
write $a\cos x+b\sin x=A(c\sin x+d\cos x)+B\dfrac{d(c\sin x+d\cos x)}{dx}\ \ \ \ (1)$
So, $\int\dfrac{a\cos x+b\sin x}{c\sin x+d\cos x}dx=A\int\ dx+B\dfrac{d(c\sin x+d\cos x)}{(c\sin x+d\cos x)dx}dx$ $=Ax+\int\dfrac{d(c\sin x+d\cos x)}{(c\sin x+d\cos x)}=Ax+B\ln|c\sin x+d\cos x|+K$
Now from $(1)$, $a\cos x+b\sin x=A(c\sin x+d\cos x)+B(c\cos x-d\sin x)=(Ac-Bd)\sin x+(Ad+Bc)\cos x$
and equating the coefficients of $\cos x,\sin x;$ $Ac-Bd=b,Ad+Bc=a$
This simultaneous equation can be easily solved for $A,B$ in terms of $a,b,c,d$(given)
Can you recognize $a,b,c,d$ here?
Hint:
Multiply the integrand by $\cos x$, we get \begin{equation} \frac{\cos x}{\cos x+\sin x} \end{equation} then let \begin{equation} I=\int\frac{\cos x}{\cos x+\sin x}dx \end{equation} and \begin{equation} J=\int\frac{\sin x}{\cos x+\sin x}dx \end{equation} Find $I+J$ and $I-J$, where $I-J$ can be found by using \begin{equation} \int\frac{f'(x)}{f(x)}dx=\ln\left|f(x)\right|+C \end{equation}