Wednesday 31 March 2021

MathPix Snipping Tool

In my previous post I looked at how to integrate a function using the Feynman technique. The function was:$$ \int_0^1 \frac{\sin( \ln x)}{\ln x}$$It seems that blackpenredpen is fond of integrations that make use of the Feynman technique. Here is another such integral:$$\int_0^1 \frac{x-1}{\ln x} $$Here is the YouTube link. I've done the integration using pen and paper and it took me very little time as compared to how long it would have taken me using LaTeX. See Figure 1.


Figure 1

What would be good is if there was a way to convert this automatically to LaTeX, a sort of LaTeX recognition rather than text recognition. Well, it turns out that there is. I used a program called MathPix Snipping Tool and the entire page was converted instantly to LaTeX with only two minor errors. Even equal signs were aligned. This is a remarkable time saver.$$\begin{aligned}
\int_{0}^{1} \frac{x-1}{\ln x} & d x \\
\operatorname{let} I(b) &=\int_{0}^{1} \frac{x^{b}-1}{\ln x} \cdot d x \\
\frac{d}{d t} I(b) &=\frac{d}{d b} \int_{0}^{1} \frac{x^{b}-1}{\ln x} \cdot d x \\
I^{\prime}(b) &=\int_{0}^{1} \frac{\partial}{\partial b}\left(x^{b}-1\right) \cdot \frac{1}{\ln x} d x \\
&=\int_{0}^{1} \ln x \cdot x^{b} \cdot \frac{1}{\ln x} d x \\
&=\int_{0}^{1} x^{b} d x \\
&=\left[\frac{x^{b+1}}{b+1}\right]_{0}^{1} \\
&=\frac{1}{b+1} \\
I(b) &=\ln |b+1|+C \\
I(0) &=\int_{0}^{1} \frac{x^{0}-1}{\ln x} \cdot d x \\
&=0 \\
\therefore C &=0 \\
I(1) &=\ln |b+1| \\
I(1) &=\ln (2) \\
\therefore \int_0^1 \frac{x-1}{\ln x} d x&=\ln (2)
\end{aligned}$$The free version allows for 50 snips per month which is more than reasonable. Just write out the solution carefully and clearly on paper and then snip it! I'm still blown away by the ease with which this conversation is possible. 

Here is another try. Figures 2 and 3 shows the photographs. Figure 3 worked fine but Figure 2 gave me no end of trouble. It's important that the confidence level shows at least some red (which Figure 3 did and Figure 2 didn't). A good photograph is of course essential. The program makes multiple attempts which can then be trialed.


Figure 2



Figure 3
$$
\begin{array}{l}
\displaystyle \int_{0}^{1} \dfrac{\ln x}{x-1} \cdot d x \\
\text { let } u=x-1 \\
x=1+u \\
\quad d u=d x \\
\displaystyle \int_{u=-1}^{u=0} \dfrac{\ln (1+u)}{u} d u \\
\dfrac{1}{1-t}= \displaystyle \sum_{n=0}^{\infty} t^{n},|t|<1 \\
\text { let } t=-u \\
\dfrac{1}{1+u}=\displaystyle \sum_{n=0}^{\infty}(-1)^{n} \cdot u \\
\begin{array}{l}
\int \dfrac{1}{1+u} d u=\displaystyle \int \sum_{n=0}^{\infty}(-1)^{n} u^{n} d u \\
\ln (u+1)=\displaystyle C+\sum_{n=0}^{\infty}(-1)^{n} \dfrac{u^{n+1}}{n+1}
\end{array} \\
\operatorname{lit} \begin{array}{l}
u=0 \\
\ln (1+0)=\displaystyle C+\sum_{n=0}^{\infty}(-1)^{n} \cdot 0^{n+1} \\
\ln (1+u)=\displaystyle \sum_{n=0}^{\infty} \dfrac{(-1)^{n}}{n+1} \cdot u^{n+1} \\
\dfrac{\ln (1+u)}{u}=\displaystyle \sum_{n=0}^{\infty} \dfrac{(-1)^{n}}{n+1} \cdot u^{n}
\end{array}
\end{array}
$$
$$\begin{aligned}
\int_{0}^{1} \frac{\ln x}{x-1} d x &=\int_{n=-1}^{0} \frac{\ln (1+u)}{u} d u \\
&=\int_{u=-1}^{0} \sum_{n=0}^{\infty} \frac{(-1)^{n}}{n+1} \cdot u^{n} d_{n} \\
&=\left.\sum_{n=0}^{\infty} \frac{(-1)^{n}}{(n+1)^{2}} u^{n+1}\right|_{n=-1} ^{n=0} \\
&=\sum_{n=0}^{\infty} \frac{(-1)^{n}}{(n+1)^{2}} \cdot 0^{n+1}-\sum_{n=0}^{n} \frac{(-1)^{n}(-1)^{n+1}}{(n+1)^{2}} \\
&=-\sum_{n=0}^{\infty} \frac{(-1)^{2 n} \cdot(-1)}{(n+1)^{2}} \\
&=\sum_{n=0}^{\infty} \frac{1}{(n+1)^{2}} \\
&=\frac{1}{1^{2}}+\frac{1}{2^{2}}+\frac{1}{3^{2}}+\frac{1}{4^{2}}+\ldots \\
&=\frac{\pi^{2}}{6}
\end{aligned}$$Of course, mathematically printed material converts with only minor glitches. Figure 4 shows page 72 of "Catalan Numbers with Applications" by Thomas Koshy.


Figure 4

Cesáro First Order Mean

The next example, another application of Wallis's formula, was proposed in 1957 by J. Barlaz of Rutgers University, New Brunswick, New Jersey. The solution is based on the one given the following year by $\mathrm{R}$. Breusch of Amherst College, Massachusetts.

Example 3.2 Evaluate the Cesáro first order mean for the series $$\sum_{n=2}^{\infty}(-1)^{n} \log n$$Solution Let \( \displaystyle S_{m}=\sum_{n=2}^{m}(-1)^{n} \log n\). Then, by Wallis's formula,$$
\begin{array}{c}
S_{2 n}=\dfrac{2 \cdot 4 \cdots(2 n)}{3 \cdot 5 \cdots(2 n-1)} \quad \text { and } \quad S_{2 n+1}=\dfrac{2 \cdot 4 \cdots(2 n)}{3 \cdot 5 \cdots(2 n+1)} \\
\begin{align}
S_{2 n}+S_{2 n+1}&=\log \frac{2 \cdot 2}{1 \cdot 3} \cdot \dfrac{4 \cdot 4}{3 \cdot 5} \cdots \dfrac{(2 n) \cdot(2 n)}{(2 n-1) \cdot(2 n+1)} \\
&=\log (\pi / 2)+O(1 / n) \\
\displaystyle \sum_{n=2}^{m} S_{n}&=\dfrac{m}{2} \log (\pi / 2)+O(\log m)
\end{align}
\end{array}
$$Thus the Cesáro first order mean is given by$$
\lim _{m \rightarrow \infty} \dfrac{1}{m} \sum_{n=2}^{m} S_{n}=\dfrac{1}{2} \log (\pi / 2)
$$

No comments:

Post a Comment