Solving integral using trig substitution $\tan(x/2)=t$ I have problems with solving the following integral:
$$ \int{{\sin x - \cos x}\over {\sin x + \cos x}} \, dx$$
Could anybody please help me to find the solution and show me the method how it can be solved? I already tried to solve similar ones but I get always stuck when trying the technique with partial fraction decomposition.
Thanks very much in advance!
 A: $$\int\frac{\sin(x)-\cos(x)}{\sin(x)+\cos(x)}\space\text{d}x=$$

Substitute $u=\sin(x)+\cos(x)$ and $\text{d}u=(\cos(x)-\sin(x))\space\text{d}x$:

$$-\int\frac{1}{u}\space\text{d}u=-\ln\left|u\right|+\text{C}=-\ln\left|\sin(x)+\cos(x)\right|+\text{C}$$
A: Hint:
substitute $t=\sin x +\cos x$ and $dt=(\cos x - \sin x)dx$
A: Implementing the half-angle substitution (per your title), you have
$$t=\tan\frac{x}{2}\implies\mathrm{d}t=\frac{1}{2}\sec^2\frac{x}{2}\,\mathrm{d}x$$
From the fact that $t=\tan\dfrac{x}{2}$, you can extract the following:
$$\begin{cases}\sin x=2\sin\dfrac{x}{2}\cos\dfrac{x}{2}=\dfrac{2t}{1+t^2}\\[1ex]
\cos x=\cos^2\dfrac{x}{2}-\sin^2\dfrac{x}{2}=\frac{1-t^2}{1+t^2}\\[1ex]
\sec^2\dfrac{x}{2}=1+t^2\end{cases}$$
All of this tells you your initial integral is equivalent to
$$\int\frac{\sin x-\cos x}{\sin x+\cos x}\,\mathrm{d}x=\int\frac{\frac{2t}{1+t^2}-\frac{1-t^2}{1+t^2}}{\frac{2t}{1+t^2}+\frac{1-t^2}{1+t^2}}\times\frac{2}{1+t^2}\,\mathrm{d}t=-2\int\frac{t^2+2t-1}{(t^2-2t-1)(1+t^2)}\,\mathrm{d}t$$
Decomposing into partial fractions yields
$$-2\int\left(\frac{t-1}{t^2-2t-1}-\frac{t}{t^2+1}\right)\,\mathrm{d}t$$
Both integrals can easily be computed with substitutions that use the integrand's term's respective denominators.
A: Notice, $$\int \frac{\sin x-\cos x}{\sin x+\cos x}\ dx$$$$=\int \frac{-(\cos x-\sin x)}{\sin x+\cos x}dx $$
$$=-\int \frac{d(\sin x+\cos x)}{\sin x+\cos x} $$
$$=\color{red}{-\ln|\sin x+\cos x|+C}$$
A: Notice, $$\int \frac{\sin x-\cos x}{\sin x+\cos x}\ dx$$
$$=\int \frac{\frac{\sin x}{\cos x}-1}{\frac{\sin x}{\cos x}+1}\ dx$$
$$=\int \frac{\tan x-1}{\tan x+1}\ dx$$
$$=\int \frac{\tan x-\tan\frac \pi4}{1+\tan x\tan\frac \pi4}\ dx$$
$$=\int\tan\left(x-\frac{\pi}{4}\right)\ dx$$
$$=\color{blue}{\ln\sec\left(x-\frac{\pi}{4}\right)+C}$$
A: \begin{align}
\tan \frac x 2 & = t \\[8pt]
\frac x 2 & = \arctan t \\[8pt]
x & = 2\arctan t \\[8pt]
\sin x & = \sin(2\arctan t) = \sin(2 \, \bullet) = 2 \sin(\bullet)\cos(\bullet) \\
& = 2\sin(\arctan t)\cos(\arctan t), \\[8pt]
\cos x & = \cos(2\arctan t) = \cos(2\,\bullet) = \cos^2(\bullet) - \sin^2(\bullet) \\
& = \cos^2(\arctan t) - \sin^2(\arctan t).
\end{align}
Now let us consider what $\sin(\arctan t)$ and $\cos(\arctan t)$ are.
$\tan = \dfrac{\text{opposite}}{\text{adjacent}} = \dfrac t 1$ so $\text{hypotenuse} = \sqrt{t^2+1^2}$, and so we have
$$
\sin(\arctan t) = \frac{\text{opposite}}{\text{hypotenuse}} = \frac t {\sqrt{t^2+1}}.
$$
Similarly
$$
\cos(\arctan t) = \frac{\text{adjacent}}{\text{hypotenuse}} = \frac 1 {\sqrt{t^2+1}}.
$$
Consequently
$$
2\sin(\arctan t)\cos(\arctan t) = 2\cdot \frac 1 {\sqrt{t^2+1}} \cdot \frac t {\sqrt{t^2+1}} = \frac{2t}{1+t^2}.
$$
Similarly
$$
\cos^2(\arctan t) - \sin^2(\arctan t) = \frac 1 {1+t^2} - \frac t {1+t^2} = \frac{1-t^2}{1+t^2}.
$$
So now we have
$$
\left.
\begin{align}
\sin x & = \frac{2t}{1+t^2}, \\[10pt]
\cos x & = \frac{1-t^2}{1+t^2}.
\end{align}
\right\} \tag 1
$$
Finally, since $x = 2\arctan t$, we have
$$
dx = \frac{2\,dx}{1+t^2}. \tag 2
$$
Your ultimate answer comes from $(1)$ and $(2)$, followed by actually evaluating the resulting integral of a rational function.
