How can I calculate $\int \frac{\sin kx}{a+bx}\;dx$? How can I calculate $$\int \frac{\sin kx}{a+bx}\;dx \quad ?$$
I know its final solution but I don't know its solution step by step.
Thanks.
 A: If $b\neq0$
$$\int\frac{\sin(kx)}{a+bx}dx=\frac{1}{b}\int\frac{\sin(\frac{k}{b}((a+bx)-a))}{a+bx}b\,dx=\frac{1}{b}\int\frac{\sin(\frac{k}{b}u-\frac{ka}{b})}{u}du=$$
$$\frac{1}{b}\cos(\frac{ka}{b})\int\frac{\sin(\frac{ku}{b})}{u}du-\frac{1}{b}\sin(\frac{ka}{b})\int\frac{\cos(\frac{ku}{b})}{u}du$$
The last integrals can be expressed in terms of the sine integral and cosine integral.
If $b=0$
$$=\frac{1}{a}\int\sin(kx)dx=\frac{-1}{ak}\cos(kx)+C$$
A: You will not be able to do this using elementary functions only. Even with $a=0$, and $b=k=1$, we have $\int\frac{\sin{x}}{x}\,dx$, which is known to not be elementary. See this.
You can however, make new functions to add to the list of elementary functions: $$\begin{align}
S(x)&:=\int_0^x\frac{\sin(t)}{t}\,dt\\
C(x)&:=\int_0^x\frac{\cos(t)-1}{t}\,dt&\mbox{(the $-1$ makes $C$ continuous everywhere)}
\end{align}$$
and then with these, in the cases with $b\neq0$ (since the $b=0$ case is just a basic integral) and using the substitution $u=\frac{a}{b}+x$:
$$\begin{align}
\int\frac{\sin(kx)}{a+bx}\,dx&= \int\frac{\sin\left(ku-\frac{ka}{b}\right)}{bu}\,du\\
&=\frac{1}{b}\int\frac{\sin(ku)\cos\left(\frac{ka}{b}\right)-\cos(ku)\sin\left(\frac{ka}{b}\right)}{u}\,du\\
&=\frac{1}{b}\int\frac{\sin(ku)\cos\left(\frac{ka}{b}\right)-\left(\cos(ku)-1\right)\sin\left(\frac{ka}{b}\right)-\sin\left(\frac{ka}{b}\right)}{u}\,du\\
&=\frac1b\left(\cos\left(\frac{ka}{b}\right)S(ku)-\sin\left(\frac{ka}{b}\right)C(ku)-\sin\left(\frac{ka}{b}\right)\ln\left\vert u\right\vert\right)+C\\
&=\frac{\cos\left(\frac{ka}{b}\right)}{b}S\left(\frac{ka}{b}+kx\right)-\frac{\sin\left(\frac{ka}{b}\right)}{b}C\left(\frac{ka}{b}+kx\right)-\frac{\sin\left(\frac{ka}{b}\right)}{b}\ln\left\vert \frac{a}{b}+x\right\vert+C\\
\end{align}$$
(For the sake of a completely general antiderivative, $C$ can have different values on different sides of the discontinuity resulting from the logarithm. That is, $C$ can have different values for $x$ on either side of $-{\frac{a}{b}}$.)
