## Find the Derivative of $$f(x) = \int_{0}^{x^{2}} \frac{\sin(z)}{z} \mathrm{d}z$$

How to find the derivative of

f(x) = \int\limits_{0}^{x^{2}} \frac{\sin(z)}{z} \mathrm{d}z

was a question posed at Mathematics Stack Exchange. There is an obvious solution posted there, but here I present an alternative solution. While it is less efficient than the answer at MSE it is interesting.

Using the series definition of the sine function we have

\sin(z) = \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{(2n-1)!} x^{2n-1}

and
\begin{align}
f(x) &= \int\limits_{0}^{x^{2}} \frac{\sin(z)}{z} \mathrm{d}z \\
&= \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{(2n-1)!} \int\limits_{0}^{x^{2}} z^{2n-2} \mathrm{d}z
\end{align}

The integral on the right hand side above is

\int\limits_{0}^{x^{2}} z^{2n-2} \mathrm{d}z = \frac{1}{2n-1} (x^{2})^{2n-1}

and now we have

f(x) = \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{(2n-1)!(2n-1)} (x^{2})^{2n-1}

Let

g(x) = (x^{2})^{2n-1}

and

\frac{\mathrm{d}g}{\mathrm{d}x} = \frac{2}{x}(2n-1)(x^{2})^{2n-1}

Now we have
\begin{align}
\frac{\mathrm{d}f}{\mathrm{d}x} &= \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{(2n-1)!(2n-1)} \frac{\mathrm{d}g}{\mathrm{d}x} \\
&= \frac{2}{x} \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{(2n-1)!} (x^{2})^{2n-1} \\
&= \frac{2}{x} \sin(x^{2})
\end{align}

## Evaluate the Integral $$\int_{-\infty}^{\infty} \frac{\sin(ax)}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x$$

How to prove

I=\int\limits_{-\infty}^{\infty} \frac{\sin(ax)}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x = \pi \tanh(\pi a)
\tag{1}
\label{eq:sinsinh-1}

was a question on Mathematics Stack Exchange. I will provide a solution similar to one at MSE but more fully worked out. Also, I will show an interesting relation between the digamma function and the tangent function due to another solution at MSE.

\begin{align}
I &= -i \int\limits_{0}^{\infty} \frac{\mathrm{e}^{iax}-\mathrm{e}^{-iax}}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x \\
&= -i \int\limits_{0}^{\infty} \mathrm{e}^{-x/2} \frac{\mathrm{e}^{iax}-\mathrm{e}^{-iax}}{1-\mathrm{e}^{-x}}\mathrm{d}x \\
&= -i \int\limits_{0}^{\infty} \mathrm{e}^{-x/2} \left( \mathrm{e}^{iax}-\mathrm{e}^{-iax} \right) \sum\limits_{n=0}^{\infty} \mathrm{e}^{-nx}\mathrm{d}x \\
&= -i \int\limits_{0}^{\infty} \Big[\sum\limits_{n=0}^{\infty} \mathrm{e}^{-x(1/2+n-ia)} \,-\, \sum\limits_{n=0}^{\infty} \mathrm{e}^{-x(1/2+n+ia)} \Big] \mathrm{d}x \\
\tag{2}
\label{eq:sinsinh-2}
&= -i \Big[\sum\limits_{n=0}^{\infty} \frac{1}{1/2+n-ia} \,-\, \sum\limits_{n=0}^{\infty} \frac{1}{1/2+n+ia}\Big] \\
&= 2a \sum\limits_{n=0}^{\infty} \frac{1}{(n+1/2)^{2}+a^{2}}
\end{align}

The Mittag-Leffler expansion of the hyperbolic tangent function is

\tanh(z) = 2z \sum\limits_{n=0}^{\infty} \frac{1}{n^{2}(\pi/2)^{2}+z^{2}}
\tag{3}
\label{eq:sinsinh-3}

For $$z=a\pi$$ we have our final result

\int\limits_{-\infty}^{\infty} \frac{\sin(ax)}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x = 2a \sum\limits_{n=0}^{\infty} \frac{1}{(n+1/2)^{2}+a^{2}} = \pi \tanh(\pi a)

Now, let us examine equation \eqref{eq:sinsinh-2} and use it to recover a definition of the tangent in terms of the digamma function.

Using a series definition of the digamma function:

\psi(z) = -\gamma + \sum\limits_{n=0}^{\infty} \left( \frac{1}{n+1} – \frac{1}{n+z} \right)
\tag{4}
\label{eq:sinsinh-4}

we have

\psi\left(\frac{1}{2}+ia\right) = -\gamma + \sum\limits_{n=0}^{\infty} \left( \frac{1}{n+1} – \frac{1}{(n+1/2)+ia} \right)
\tag{5a}
\label{eq:sinsinh-5a}

and

\psi\left(\frac{1}{2}-ia\right) = -\gamma + \sum\limits_{n=0}^{\infty} \left( \frac{1}{n+1} – \frac{1}{(n+1/2)-ia} \right)
\tag{5b}
\label{eq:sinsinh-5b}

Subtracting equation \eqref{eq:sinsinh-5b} from \eqref{eq:sinsinh-5a} and multiplying the result by $$-i$$ yields equation \eqref{eq:sinsinh-2} which is equal to equation \eqref{eq:sinsinh-1}.

Making the substitution $$z=\frac{1}{2}+ia$$ yields
\begin{align}
-i\big[\psi(z)-\psi(1-z)\big] &= \pi \tanh\Big[-i\pi\left(z-\frac{1}{2}\right)\Big] \\
&= -i \pi \tan\Big[\pi\left(z-\frac{1}{2}\right)\Big] \\
&= -i \pi \cot(\pi z)
\end{align}

Rearrangement yields

\psi(z)-\psi(1-z) = \frac{-\pi}{\tan(\pi z)}

an expression which can be found here.

## Shifting the Expansion Point of a Power Series

If we have a function that has been expanded in a power series about the point $$x = x_{0}$$

f(x) = \sum\limits_{n=0}^{\infty} a_{n} (x – x_{0})^{n}

and if the radius of convergence of this series is non-zero, then we can generate a power series expansion about a new point $$x = x_{1}$$ if this point is in the radius of convergence of the original power series. The new series is [1]

f(x) = \sum\limits_{k=0}^{\infty} b_{k} (x – x_{1})^{k}

b_{k} = \sum\limits_{n=0}^{\infty}
\begin{pmatrix}
n+k \\
k
\end{pmatrix}
a_{n+k} (x_{1} – x_{0})^{n}

While this is clearly not practical for paper and pencil solutions, it does appear that it could be useful for computer applications. If you had an algorithm for determining the coefficients of the original power series and you wanted to generate many new power series with different expansion points, then this formulation would allow one to do this by only have to store the coefficients of the original power series. One can imagine having a series of expansion points, $$x_{1}s$$, running a loop over them, and using this algorithm to generate different representations of the given function as power series.

[1] Theory and Application of Infinite Series by Konrad Knopp.