miércoles, 17 de julio de 2024

Showing $\frac{1}{e^{i\alpha_2}} + \frac{1}{e^{i\beta_2}} + \frac{1}{e^{i\gamma_2}} = \frac{1}{e^{i(\alpha_2+\beta_2+\gamma_2)}}$

Let $x$ be any of $\alpha_1$, $\beta_1$, or $\gamma_1$ and suppose $\alpha_1+\beta_1+\gamma_1=\pi$. Then

$$e^{i(\alpha_2+\beta_2)}+e^{i(\alpha_2+\gamma_2)}+e^{i(\beta_2+\gamma_2)}=1\qquad \left(x \in \mathbb{R} : \frac{x + \pi}{2\pi} \not\in \mathbb{Z}\right)\tag{1}$$
or
$$\frac{1}{e^{i\alpha_2}} + \frac{1}{e^{i\beta_2}} + \frac{1}{e^{i\gamma_2}} = \frac{1}{e^{i(\alpha_2+\beta_2+\gamma_2)}},\qquad \left(x = 2\pi n + \pi, \quad n \in \mathbb{Z}\right) \tag{2}$$

where complex $\alpha_2=\cos^{-1}(\csc(\alpha_1))$ and similarly for $\beta_2$ and $\gamma_2$.

The identities $(1-2)$ are consequences of Theorem 1 in this blog post and the trigonometric identities 3 and 4 (counting from top to bottom) in this list.

Addendum: generalize $(1-2)$.

viernes, 5 de julio de 2024

Integrals of the form $\int f\left(x,\frac{\sqrt{x+m}}{\sqrt{x+n}}\right)\,dx$

We give a general approach for integrals of the form $\int f\left(x,\frac{\sqrt{x+m}}{\sqrt{x+n}}\right)\,dx$.

Let $b-a=m$ and $b+a=n$, where $a$ and $b$ are real numbers. Then the following identities hold:

$$\frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}=\tan{\left(\frac12\sec^{-1}\left(\frac{x+b}{a}\right)\right)}=\frac{\sqrt{x+b-a}}{\sqrt{x+b+a}}=\frac{\sqrt{x+m}}{\sqrt{x+n}},\tag{1}$$

$$e^{\pm\text{i}\alpha}=\tan\left(\frac{1}{2} \csc^{-1}\left(\frac{x+b}{a}\right)\right) = \frac{x + b - \sqrt{(x + b)^2 - a^2}}{a}\tag{2}$$

These identities are generalizations of identities $(1-2)$ and $(9-10)$ at "Integration using Euler-like identities" and can be derived similarly as shown in the linked blog. The general identities $(1)$ and $(2)$ lead us to the following general transformation formula: 

$$\boxed{\int f\left(x,\tan{\frac{\beta}{2}}, \tan{\frac{\gamma}{2}} \right)\,dx=\int f\left(\frac{e^{i\alpha}+e^{-i\alpha}}{2}a, e^{\pm\text{i}\alpha}, \frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}\right)\,\frac{e^{-\text{i}\alpha}-e^{\text{i}\alpha}}{2i}a\,d\alpha}\tag{3}$$

Where $\alpha=\cos^{-1}\left(\frac{x+b}{a}\right)$, $\beta=\csc^{-1}\left(\frac{x+b}{a}\right)$ and $\gamma=\sec^{-1}\left(\frac{x+b}{a}\right).$ Use the upper sign for the alternating signs $\mp$ when $\frac{x + b}{a} \geq 1$ and the lower sign when $0 \leq \frac{x + b}{a} \leq 1$.

To illustrate its usefulness, let's look at the following example taken from the YouTube channel Prime Newtons.

Example 1. Evaluate 

$$\int \frac{\sqrt{x+1}}{\sqrt{x+2}}\,dx$$

Solution. First, we obtain the values of $a$ and $b$ by solving the following (simple!) system of equations:

$$\left. b-a=1\atop a+b=2\right\}$$

The solutions are $a = \frac{1}{2}$ and $b = \frac{3}{2}$. Applying formula $(3)$ for $x\geq-1$, the integral becomes

$$\begin{aligned}\int \frac{\sqrt{x+1}}{\sqrt{x+2}}\,dx&= -\frac{i}{4}\int \frac{(1 - e^{i\alpha}) (e^{-i\alpha} - e^{i\alpha})}{(e^{i \alpha} + 1)} \, d\alpha\\&=-\frac{i}{4}\int \frac{e^{-i\alpha} (e^{i\alpha} - 1) (e^{2i\alpha} - 1)}{e^{i\alpha} + 1} \, dx\\&=-\frac{i}{4}\int e^{-i\alpha}(e^{i\alpha}-1)^2\,d\alpha\\&=-\frac{i}{4}\int (e^{-i\alpha}+e^{i\alpha}-2)\,d\alpha\\&=\frac14(2i\alpha+e^{-i\alpha}-e^{i\alpha})+C\end{aligned}$$

To switch to real numbers, replace from $(2)$, then replace the values of $a$ and $b$ and simplify, obtaining

$$=\sqrt{x^2+3x+2} + \frac{1}{2} \ln\left|2x - 2\sqrt{x^2+3x+2} + 3\right|+C$$

On the Prime Newtons YouTube channel, they first perform a variable change, followed by a trigonometric substitution, reducing the integral to integrals involving the secant and secant cubed. This integral calculator uses $u^2 = \frac{x+1}{x+2}$ and then (a complicated) partial fraction decomposition. This can be even more complicated for integral like this one:

$$\int \frac{x\sqrt{x+1}}{\sqrt{x+2}}\,dx$$

where as our method only requires a few lines of algebra and basic calculus, as in Example 1. 

jueves, 21 de marzo de 2024

A new integration technique via Euler-like identities

"Complexification formulas are great and it seems like this simplifies the right away."
- Ninad Munshi


We introduce Exponential Substitution, which is a transformation that simplifies certain composite trigonometric integrals and offers an alternative approach to integrating through trigonometric, hyperbolic, and Euler substitutions. Examples 2, 3, 7, 8, 9, 10 and 11 illustrate how this method could be more efficient than the traditional approaches.

Although closely related to integration using Euler's formula, the technique you will see below is not exactly the same. For instance, Example 1 becomes more complicated if we try to use complex sine and cosine functions.

Some Euler-like identities

The following identities have been suggested based on formulas in this blog post.

Theorem 1. If complex $\alpha=\cos^{-1}(x)$ and $\beta=\csc^{-1}(x)$, where real $x\in[1, \infty)$, then the following relation holds:

\[\boxed{e^{i\alpha}=\tan\left(\frac{\beta}{2}\right)}\tag{1}\]

In the complex plane, for real $x\in[0, 1]$, we have

\[\boxed{e^{-i\alpha}=\tan\left(\frac{\beta}{2}\right)}\tag{2}\]

 Proof. Consider the left-hand side of equation $(1)$. By Euler's formula and properties of inverse trigonometric functions, the exponential $e^{i\cos^{-1}(x)}$ can be rewritten as follows.

\[e^{i\cos^{-1}{(x)}}=\cos{(\cos^{-1}{(x)})}+i\sin{(\cos^{-1}{(x)})}=x+i\sqrt{1-x^2}\]

The right-hand side of $(1)$ can be written as follows.


\[\tan{\left(\frac{\csc^{-1}{(x)}}{2}\right)}=\frac{\sin{(\csc^{-1}{(x)}})}{1+\cos{(\csc^{-1}{(x)}})}=\frac{\frac{1}{x}}{1+\frac{\sqrt{x^2-1}}{x}}=x-\sqrt{x^2-1}\]

Now we just need to find the solution set for non-negative real $x$ of the following complex equation.

\[x+i\sqrt{1-x^2}=x-\sqrt{x^2-1}\tag{3}\]

Clearly, equation $(3)$ is true for $x=1$. For $x>1$, it follows that $1-x^2<0$, and therefore, the left-hand side of $(3)$ simplifies to $x-\sqrt{x^2-1}$. Consequently, equation $(3)$ is true for $x\geq1$.

For identity $(2)$, equation $(3)$ becomes

\[x-i\sqrt{1-x^2}=x-\sqrt{x^2-1}\tag{4}\]

If $0 \leq x \leq 1$, then $x^2 - 1 < 0$. Therefore, the right-hand side of equation $(4)$ can be rewritten as $x - i\sqrt{1 - x^2}$, making equation $(4)$ valid for $[0, 1]$ in the complex plane.

$\square$

The functions on both sides of identity $(1)$ are continuous for $x \geq 1$. And for identity $(2)$, continuity is guaranteed on $[0, 1]$ for complex numbers.

Remark If complex $\alpha=\cos^{-1}(x)$ and $\beta=\csc^{-1}(x)$, where real $x\in[-1, 1]$, then the following relation holds:

\[\boxed{e^{i\alpha}=\cot\left(\frac{\beta}{2}\right)}\tag{5}\]

This is true because identity $(5)$ can be rewritten as:

\[x+i\sqrt{1-x^2}=x+\sqrt{x^2-1}\tag{6}\]

And the solution set of $(6)$ is $x \in [-1, 1]$.

Theorem 2. If complex $\alpha=\cos^{-1}(x)$ and $\gamma=\sec^{-1}(x)$, where real $x\in [1, \infty)$, then the following relation holds:

\[\boxed{e^{i\alpha}=\frac{1-\tan\left(\frac{\gamma}{2}\right) }{1+\tan\left(\frac{\gamma}{2}\right)}}\tag{7}\]

In the complex plane, for $x\in [0, 1]$, we have

\[\boxed{e^{-i\alpha}=\frac{1-\tan\left(\frac{\gamma}{2}\right) }{1+\tan\left(\frac{\gamma}{2}\right)}} \tag{8}\]

Proof. By property of inverse trigonometric functions we have

\[\tan{\left(\frac{\sec^{-1}(x)}{2}\right)}=\frac{\sin{(\sec^{-1}(x))}}{1+\cos{(\sec^{-1}(x))}}=\frac{\frac{\sqrt{x^2-1}}{x}}{1+\frac{1}{x}}=\frac{\sqrt{x-1}}{\sqrt{x+1}}\]

Substituting into the right-hand side of identity $(7)$, we obtain

$$\frac{1-\tan\left(\frac{\gamma}{2}\right)}{1+\tan\left(\frac{\gamma}{2}\right)}=\frac{1-\frac{\sqrt{x-1}}{\sqrt{x+1}}}{1+\frac{\sqrt{x-1}}{\sqrt{x+1}}}=x-\sqrt{x^2-1}$$

Hence, the same argument for Theorem 1 applies to Theorem 2, and both identities $(7)$ and $(8)$ are continuous on their respective intervals, with identity $(8)$ being valid in the complex plane.

$\square$

For $x\in[1,\infty)$, identity $(7)$ can be rewritten as follows:

\[\boxed{\tan{\left(\frac{\gamma}{2}\right)}=\frac{1-e^{i\alpha}}{1+e^{i\alpha}}}\tag{9}\]

And in the complex plane, for $x\in[0, 1]$, identity $(8)$ can be rewritten as follows:

\[\boxed{\tan{\left(\frac{\gamma}{2}\right)}=\frac{1-e^{-i\alpha}}{1+e^{-i\alpha}}}\tag{10}\]

Remark For similar reasons to those given for identity $(5)$, for \(x \in [-1, 1]\), the following identity holds:

\[\boxed{\cot{\left(\frac{\gamma}{2}\right)}=\frac{1+e^{i\alpha}}{1-e^{i\alpha}}}\tag{11}\]

Applications

Example 1. Evaluate \[\int_{1}^{2}\sqrt[3]{\tan{\left(\frac12\csc^{-1}(x)\right)}} \, dx\tag{12}\]

Solution. Using identity $(1)$, integral $(12)$ becomes:

\[\int_{1}^{2} e^{\frac{1}{3}i\alpha}dx\]

Since $\alpha=\cos^{-1}(x)\implies d\alpha=-\frac{1}{\sqrt{1-x^2}}\,dx$ and $x=\cos{(\alpha)}$.

$$\begin{aligned}\int_{1}^{2} e^{\frac{1}{3}i\alpha}dx&= -\int_{1}^{2} e^{\frac{1}{3}i\alpha}\sqrt{1-\cos^2{(\alpha)}}\,d\alpha\\&=-\int_{1}^{2} e^{\frac{1}{3}i\alpha}\sin{(\alpha)}\,d\alpha\\&=-\frac{i}{2}\int_{1}^{2}(e^{-\frac23i\alpha}- e^{\frac43i\alpha})\,d\alpha\qquad (\text{Since $\sin{(\alpha)}=\frac12i(e^{-i\alpha}-e^{i\alpha}$}).)\\&=\frac34e^{-\frac23i\alpha}+\frac38e^{\frac43i\alpha}\bigg|_1^2\\&=\frac38e^{-\frac23i\alpha}(e^{2i\alpha}+2)\bigg|_1^2\\&=\frac{3\left((x-\sqrt{x^2-1})^2+2\right)}{8(x-\sqrt{x^2-1})^{2/3}}\bigg|_1^2\qquad (\text{Changing back to reals.})\\&=\frac{{3(2 + (2 - \sqrt{3})^2)}}{{8(2 - \sqrt{3})^{\frac{2}{3}}}} - \frac{9}{8}\\&\approx0.744\end{aligned}$$

Another approach involves using the simplification $\tan{\left(\frac12\csc^{-1}{(x)}\right)}=x-\sqrt{x^2-1}$. However, this method could lead to more complicated integrals, especially when evaluating rational trigonometric integrals with multiple terms involving $\tan{\left(\frac12\csc^{-1}{(x)}\right)}$ or $\tan{\left(\frac12\sec^{-1}{(x)}\right)}$ or both. Making an appropriate u-substitution might not be immediately obvious in those cases, whereas using identities $(1)$ and $(9)$ quickly turns the integral into an integral of a rational function. As an illustration, let's consider the following example. 

Example 2. Evaluate

\[\int\frac{1}{\tan\left(\frac{1}{2}\csc^{-1} (x)\right) - \tan\left(\frac{1}{2}\sec^{-1}(x)\right)} \, dx\]

Solution. First, we rewrite the integral using the identity $(1)$ and $(9)$:

\[\int \frac{1}{e^{i\alpha} - \frac{1 - e^{i\alpha}}{1 + e^{i\alpha}}} \, dx=\int\frac{1+e^{i\alpha}}{e^{2i\alpha}+2e^{i\alpha}-1}\,dx\]

Similar to how we proceeded in example 1, since $\alpha=\cos^{-1}(x)\implies d\alpha=-\frac{1}{\sqrt{1-x^2}}\,dx$ and $x=\cos{(\alpha)}$. Then

$$\begin{aligned}\int\frac{1+e^{i\alpha}}{e^{2i\alpha}+2e^{i\alpha}-1}\,dx &=-\int\frac{1+e^{i\alpha}}{e^{2i\alpha}+2e^{i\alpha}-1}\sqrt{1-\cos^2(\alpha)}\,d\alpha\\&=-\int\frac{1+e^{i\alpha}}{e^{2i\alpha}+2e^{i\alpha}-1}\sin(\alpha)\,d\alpha\\&=-\frac{i}{2}\int\frac{e^{-i\alpha} - e^{i\alpha} - e^{2i\alpha} + 1}{e^{2i\alpha}+2e^{i\alpha}-1}\,d\alpha\end{aligned}$$

Let $u=e^{i\alpha}\implies du=ie^{i\alpha}\,d\alpha$. Then, putting terms over a common denominator, and factoring, we have

$$-\frac{i}{2}\int\frac{e^{-i\alpha} - e^{i\alpha} - e^{2i\alpha} + 1}{e^{2i\alpha}+2e^{i\alpha}-1}\,d\alpha=\frac12\int\frac{(u - 1) (u + 1)^2}{u^2 (u^2 + 2 u - 1)}\,du$$

At this point, we can proceed by applying partial fraction decomposition.

Remark. In the MathSE forum, I asked about alternative approaches to the integral in example 2. Zacky has suggested the following substitution

$$\int \frac{1}{x-\sqrt{x^2-1}-\sqrt{\frac{x-1}{x+1}}}\,dx \overset{\frac{x-1}{x+1}=t^2}{=}4\int \frac{t}{(1+t)(1-t)^2(1-2t-t^2)}\,dt$$

However, as the reader may have noticed by the degree of the denominator, I would argue that this substitution leads us to a more complicated partial fraction decomposition. Look here and here and compare for yourself. 

The following integral was asked by user SAQ on the MathSE forum.

Example 3. Evaluate

\[ \int\dfrac{\sqrt{x-1}-\sqrt{x+1}}{\sqrt{x-1}-3\sqrt{x+1}}\,dx\]

Solution. We first divide both the numerator and denominator by $\sqrt{x+1}$:

\[\int\dfrac{\sqrt{x-1}-\sqrt{x+1}}{\sqrt{x-1}-3\sqrt{x+1}}\,dx = \int\dfrac{\frac{\sqrt{x-1}}{\sqrt{x+1}}-1}{\frac{\sqrt{x-1}}{\sqrt{x+1}}-3}\,dx\]

Now, we'll substitute $\frac{\sqrt{x-1}}{\sqrt{x+1}}$ with $\frac{1-e^{i\alpha}}{1+e^{i\alpha}}$ using the identity $(9)$:

\[= \int\dfrac{\frac{1-e^{i\alpha}}{1+e^{i\alpha}}-1}{\frac{1-e^{i\alpha}}{1+e^{i\alpha}}-3}\,dx\]

As $\alpha = \cos^{-1}(x)$, then $x = \cos{\alpha}$ and $dx = -\sqrt{1-x^2}\,d\alpha = -\sqrt{1-\cos^2{(\alpha)}}\, d\alpha = -\sin{(\alpha)}\,d\alpha$. Now, we'll perform the substitution:

\[= -\int\dfrac{\frac{1-e^{i\alpha}}{1+e^{i\alpha}}-1}{\frac{1-e^{i\alpha}}{1+e^{i\alpha}}-3}\sin{(\alpha)}\,d\alpha\]

Since $\sin(\alpha) = \frac{i}{2}(e^{-i\alpha} -  e^{i\alpha})$ and simplifying, we get:

\[\frac{i}{2}\int \frac{e^{2i\alpha}-1}{2e^{i\alpha}+1} \, d\alpha\]

Now, let $u = e^{i\alpha}$. Then, $du = ie^{i\alpha}\,d\alpha = iu\,d\alpha$ and $d\alpha = \frac{1}{iu}\,du$. Substituting, performing long division, and then decomposing into partial fractions,

\[ \begin{aligned}\frac12\int \frac{u^2 - 1}{u(2u + 1)} \, du&=\frac14\int 1\,du - \frac14\int \frac{u+2}{u(2u+1)}\,du\\&=\frac14\int1\,du -\frac12\int\frac{1}{u}\,du+\frac38\int\frac{1}{2u+1}\,du\\&=\frac{u}{4}-\frac{\ln{u}}{2}+\frac38\ln{|2u+1|}+C\\&=\frac{u}{4}+\frac12\ln{\left|\frac{(2u+1)^{\frac34}}{u}\right|}+C\\&=\frac{e^{i\alpha}}{4}+\frac12\ln{\left|\frac{(2e^{i\alpha}+1)^{\frac34}}{e^{i\alpha}}\right|}+C\\&=\frac{x-\sqrt{x^2-1}}{4}+\frac12\ln{\left|\frac{(2(x-\sqrt{x^2-1})+1)^{\frac34}}{x-\sqrt{x^2-1}}\right|}+C\end{aligned} \]

The following example has been taken from the popular YouTube channel, Blackpenredpen

Example 4. Evaluate

$$\int\sqrt{\frac{1-x}{1+x}}\,dx$$

Solution. For $x\in[0, 1]$, applying identity $(10)$, we have

$$\begin{aligned}\int\sqrt{\frac{1-x}{1+x}}\,dx&=i\int\sqrt{\frac{x-1}{x+1}}\,dx\\&=-i\int\frac{1-e^{-i\alpha}}{1+e^{-i\alpha}}\sin(\alpha)\,d\alpha\\&=\frac12\int\frac{(e^{-i\alpha}-1)(e^{-i\alpha}-e^{i\alpha})}{1+e^{-i\alpha}}\,d\alpha\\&=\frac12\int((e^{-i\alpha}+e^{i\alpha})-2)\,d\alpha\\&=\frac12\int2(\cos(\alpha)-1)\,d\alpha\\&=\sin(\alpha)-\alpha+C\\&=\sqrt{1-x^2}-\cos^{-1}(x)+C\end{aligned}$$

You can arrive at this same expression by using the trigonometric substitution $x = \cos(t)$, as some commented on the channel.

An alternative method to trig./hyp./Euler substitutions
Perhaps the reader will have noticed that the technique described above serves as an alternative method to trigonometric substitution. In fact, if we adapt equations $(1)$ and $(9)$, we will have the following more general expressions:

$$e^{i\cos^{-1}\left(\frac{x}{a}\right)}=\tan\left(\frac{1}{2}\csc^{-1}\left(\frac{x}{a}\right)\right)=\frac{1}{a}(x-\sqrt{x^2-a^2})\tag{13}$$$$\frac{1-e^{i\cos^{-1}\left(\frac{x}{a}\right)}}{1+e^{i\cos^{-1}\left(\frac{x}{a}\right)}}=\tan\left(\frac{1}{2}\sec^{-1}\left(\frac{x}{a}\right)\right)=\frac{\sqrt{x-a}}{\sqrt{x+a}}\tag{14}$$

The general transformation formula is:

\[\boxed{\int f\left(x,\tan{\frac{\beta}{2}}, \tan{\frac{\gamma}{2}} \right)\,dx=\int f\left(\frac{e^{i\alpha}+e^{-i\alpha}}{2}a, e^{\pm\text{i}\alpha}, \frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}\right)\,\frac{e^{-\text{i}\alpha}-e^{\text{i}\alpha}}{2i}a\,d\alpha}\tag{15}\]

Where $\alpha=\cos^{-1}\left(\frac{x}{a}\right)$, $\beta=\csc^{-1}\left(\frac{x}{a}\right)$ and $\gamma=\sec^{-1}\left(\frac{x}{a}\right).$

Also, you can use

$$\boxed{\int f\left(x, \sqrt{x^2-a^2}, \frac{\sqrt{x-a}}{\sqrt{x+a}}\right)\,dx= \int f\left(\frac{e^{i\alpha}+e^{-i\alpha}}{2}a, \frac{e^{\mp\text{i}\alpha}-e^{\pm\text{i}\alpha}}{2}a, \frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}\right)\,\frac{e^{-\text{i}\alpha}-e^{\text{i}\alpha}}{2i}a\,d\alpha}\tag{16}$$

For the alternating signs $\mp$, use the upper sign when $\frac{x}{a} \geq 1$, and the lower sign when $0 \leq \frac{x}{a} \leq 1$.

The following example is a typical case where you would apply trigonometric substitution, specifically Case I, and it has been taken from the Wikipedia page dedicated to this technique.

Example 5. Evaluate

$$\int_{-1}^{1}\sqrt{4-x^2}\,dx$$

Solution. Rewriting and applying transformation $(16)$, we have:

$$\begin{aligned}\int_{-1}^{1}\sqrt{4-x^2}\,dx&=i\int_{-1}^{1}\sqrt{x^2-4}\,dx\\&=\int_{-1}^{1}(e^{-i\alpha}-e^{i\alpha})^2\,dx\qquad (\text{Applying transformation $(16)$.})\\&=\int_{\frac{2\pi}{3}}^{\frac{\pi}{3}} \left(e^{-2i\alpha} + e^{2i\alpha} - 2\right) d\alpha\\&= \frac{1}{2}i e^{-2i\alpha} - \frac{1}{2}i e^{2i\alpha}-2\alpha\bigg|_\frac{2\pi}{3}^\frac{\pi}{3}\\&=\sin{(2\alpha)}-2\alpha\bigg|_\frac{2\pi}{3}^\frac{\pi}{3}\\&=\left( \sin \left( \frac{2\pi}{3} \right) - \frac{2\pi}{3} \right) - \left( \sin \left( \frac{4\pi}{3} \right) - \frac{4\pi}{3} \right)\\&=\sqrt{3} + \frac{2\pi}{3} \end{aligned}$$

This result coincides with the one obtained in the Wikipedia article. The case III can also be tackled with this method. For case II, we will make use of the following identity, valid for $x \in [0, \infty)$ and $a>0$:

$$e^{\sinh^{-1}{(\frac{x}{a})}}=\coth{\left(\frac12\text{csch}^{-1}{\left(\frac{x}{a}\right)}\right)}=\frac{1}{a}\left(\sqrt{x^2+a^2}+x\right)\tag{17}$$

Example 6. Evaluate

$$\int \sqrt{x^2+1}\,dx\tag{18}$$

Solution. From $(17)$ follows that

$$\int\sqrt{x^2+1}\,dx=\int e^{\sinh^{-1}{(x)}}\,dx-\int x\,dx$$

Now let $u=\sinh^{-1}(x)\implies dx=\sqrt{x^2+1}\,du$, and $\sinh^2{(u)}=x^2$. Then

$$\begin{aligned}\int e^{\sinh^{-1}{(x)}}\,dx&=\int e^{u}\sqrt{\sinh^2(u)+1}\,du\\&=\int e^{u}\cosh(u)\,du\\&=\frac12\int e^{u}\left(e^{-u}+e^{u}\right)\,du\\&=\frac12\int \left(1+e^{2u}\right)\,du\\&=\frac{u}{2}+\frac{e^{2u}}{4}+C\\&=\frac{\sinh^{-1}(x)}{2}+\frac{e^{2\sinh^{-1}(x)}}{4}+C \end{aligned}$$

Collecting back the terms, 

$$\int\sqrt{x^2+1}\,dx=\int e^{\sinh^{-1}{(x)}}\,dx-\int x\,dx=\frac{2\sinh^{-1}(x)+e^{2\sinh^{-1}(x)}-2x^2}{4}+C$$

Compare this solution with the one provided in the Blackpenredpen and Integrals for you channels. The closed forms can be proven equivalent to the one given here easily; however, the solution given here seems much simpler to me.

The general transformation formula is:

$$\boxed{\int f\left(x, \sqrt{x^2+a^2}\right)\, dx = \int f\left(\frac{e^{\theta}-e^{-\theta}}{2}a, \frac{e^{\theta}+e^{-\theta}}{2}a\right) \frac{e^{\theta}+e^{-\theta}}{2}a\, d\theta}\tag{19}$$

Where $\theta=\sinh^{-1}(\frac{x}{a})$.

Applying $(19)$, the evaluation of integral $(18)$ is even more straightforward. The following example will make it clearer how effective $(19)$ can be.

Example 7 (2006 MIT Integration Bee). Evaluate

$$\int_{0}^{\infty} \frac{1}{\left(x+\sqrt{1+x^2}\right)^2}\,dx$$

Solution. Applying transformation $(19)$, the integral becomes

$$\begin{aligned}\int \frac{1}{\left(x+\sqrt{1+x^2}\right)^2}\,dx&=\frac12\int \frac{e^{\theta}+e^{-\theta}}{e^{2\theta}}\,d\theta\\&=\frac12\left[\int e^{-\theta}\,d\theta+\int e^{-3\theta}\,d\theta\right]\\&=\frac12\left[- e^{-\theta} - \frac{e^{-3\theta}}{3}+C\right]\\&=-\frac{1}{2\left(x + \sqrt{x^2 + 1}\right)} - \frac{1}{6\left(x + \sqrt{x^2 + 1}\right)^3}+C\qquad \left(\text{It follows from $(17)$.}\right)\\&=-\frac{{6x(\sqrt{x^2 + 1} + x) + 4}}{{6(\sqrt{x^2 + 1} + x)^3}}+C \end{aligned}$$

Now, applying the integration limits,

$$\int_{0}^{\infty} \frac{1}{\left(x+\sqrt{1+x^2}\right)^2}\,dx=-\frac{{6x(\sqrt{x^2 + 1} + x) + 4}}{{6(\sqrt{x^2 + 1} + x)^3}}\bigg|_0^\infty=\frac{2}{3}$$

In this YouTube link, you can see how both competitors fail to evaluate this integral. The solution provided in this blog also appears less tedious than the one given by the Let Solve Math Problems channel, using Euler substitution rather than the traditional trigonometric substitution.

A still more general version of $(19)$ is as follows:

$$\boxed{\int f\left(x, \sqrt{(x+b)^2+a^2}\right)\, dx = \int f\left(\frac{e^{\theta}-e^{-\theta}}{2}a-b, \frac{e^{\theta}+e^{-\theta}}{2}a\right) \frac{e^{\theta}+e^{-\theta}}{2}a\, d\theta}\tag{20}$$

Where $\theta=\sinh^{-1}(\frac{x+b}{a})$ and $a$ and $b$ are real numbers with $a>0$.

The following example also comes from a question at MathSE asked by user @user84413, where they complain that using the traditional substitutions $y=\sin(\beta)$ or $y=\tanh(\gamma)$ requires them to make a second substitution and then apply partial fraction decomposition. Example 8 illustrates how the technique presented in this blog turns out to be more effective by not requiring partial fraction decomposition.

Example 8. Evaluate

$$\int_0^1\frac{\sqrt{1-y^2}}{1+y^2}\,dy$$

SolutionBy applying the following transformation formula

$$\int f\left(y, \sqrt{y^2-a^2}, \frac{\sqrt{y-a}}{\sqrt{y+a}}\right)\,dy= \int f\left(\frac{e^{-i\alpha}+e^{i\alpha}}{2}a, \frac{e^{i\alpha}-e^{-i\alpha}}{2}a, \frac{1-e^{-i\alpha}}{1+e^{-i\alpha}}\right)\,\frac{e^{i\alpha}-e^{-i\alpha}}{2i}a\,d\alpha,$$

where $\alpha=\cos^{-1}(y)$, $y\in[0, 1]$ and $a>0$, the integral becomes

$$\begin{aligned}\int \frac{\sqrt{1-y^2}}{1+y^2}\,dy &= \int \frac{{(e^{i \alpha} - e^{-i \alpha})^2}}{{(e^{i \alpha} - e^{-i \alpha})^2 + 8}}\, d\alpha \\&= \int \frac{\sin^2(\alpha)}{\sin^2(\alpha) - 2}\, d\alpha \\&= 2\int \frac{1}{\sin^2(\alpha) - 2}\,d\alpha + \int 1\,d\alpha\\&=\int1\,d\alpha-2\int \frac{\sec^2(\alpha)}{\tan^2(\alpha)+2}\,d\alpha\qquad \left(\text{Since $\sin(\alpha)=\frac{\tan(\alpha)}{\sec(\alpha)}$.}\right)\\&=\alpha-\sqrt{2}\tan^{-1}\left(\frac{\tan(\alpha)}{\sqrt{2}}\right)+C.\qquad \left(\text{Since $\int \frac{dx}{x^2+a^2}=\frac1a\tan^{-1}\left(\frac{x}{a}\right) + C$.}\right) \end{aligned}$$

For the integration limits, we have that $\cos^{-1}(0)=\frac{\pi}{2}$ and $\cos^{-1}(1)=0$. Reversing the interval limits with a negative sign, we have

$$\begin{aligned}\int_{0}^{1} \frac{\sqrt{1-y^2}}{1+y^2}\,dy &= -\int_{0}^{\frac{\pi}{2}} \frac{\sin^2(\alpha)}{\sin^2(\alpha) - 2}\, d\alpha \\&= \sqrt{2} \tan^{-1}\left(\frac{\tan(\alpha)}{\sqrt{2}}\right) - \alpha\bigg|_{0}^{\frac{\pi}{2}}\\&=\lim_{{\alpha \to \frac{\pi}{2}^{-}}} \left( \sqrt{2} \tan^{-1}\left(\frac{\tan(\alpha)}{\sqrt{2}}\right) - \alpha \right)-0\\&=\frac{1}{2} (\sqrt{2}-1) \pi\end{aligned}$$

Alternatively, we have the option of converting the integral 

$$\int \frac{{(e^{i \alpha} - e^{-i \alpha})^2}}{{(e^{i \alpha} - e^{-i \alpha})^2 + 8}}\, d\alpha$$

into an integral of a rational function and then applying partial fraction decomposition. However, this method, although more mechanical, would not be as simple as the solution we give above.

Example 9. Evaluate 

$$\int x^2\sqrt{x^2-1}\,dx$$

SolutionAfter applying $(16)$ the integral becomes

$$\begin{aligned}\int x^2\sqrt{x^2-1}\,dx&=-\frac{i}{16}\int \left( e^{i\alpha} + e^{-i\alpha} \right)^2 \left( e^{-i\alpha} - e^{i\alpha} \right)^2 \, d\alpha\\&=-\frac{i}{16}\int \left(e^{-4 i \alpha} + e^{4 i \alpha} - 2 \right)\,d\alpha\\&=\frac{1}{64}e^{-4i\alpha} - \frac{1}{64} e^{4i\alpha} +\frac{i\alpha}{8} + C\\&=\frac{i}{32}(4\alpha - \sin(4\alpha)) + C\\&= \frac{i}{32}(4\cos^{-1}(x) - \sin(4\cos^{-1}(x))) + C\\&=\frac{1}{8}\left(\ln|x-\sqrt{x^2-1}| +x \left(2x^2-1\right) \sqrt{x^2-1}\right) + C  \end{aligned}$$

Example 9 is a question by Chomowicz. I cordially invite the reader to compare the solution given in this blog with the solutions on MathSE.

Example 10 (From MathSE). Evaluate

$$\int \ln{\left(x+\sqrt{x^2-1}\right)}\,dx$$

Solution. Applying $(16)$ the integral becomes

$$\begin{aligned}\int\ln\left(x+\sqrt{x^2-1}\right)\,dx&=i\int \alpha\sin{\alpha}\,d\alpha\\&\overset{ibp}{=}i\left(-\alpha\cos{\alpha}+\int \cos{\alpha}\,d\alpha\right)\\&=i\left(\sin{\alpha}-\alpha\cos{\alpha}\right)+C\\&=i\left(\sin{\left(\cos^{-1}(x)\right)}-x\cos^{-1}(x)\right)+C\\&=i\sqrt{1-x^2}-x\color{red}{i\cos^{-1}(x)}+C\\&=-\sqrt{x^2-1}-x\color{red}{\log{\left(x-\sqrt{x^2-1}\right)}}+C\\&=x\ln{\left(x+\sqrt{x^2-1}\right)}-\sqrt{x^2-1}+C \end{aligned}$$

Note: $\color{red}{i\cos^{-1}(x)=\ln{\left(x-\sqrt{x^2-1}\right)}}$ follows from identity $(1)$.

Integrals of the form $\int f\left(x,\frac{\sqrt{x+m}}{\sqrt{x+n}}\right)\,dx$

Let $b-a=m$ and $b+a=n$, where $a$ and $b$ are real numbers. Then the following identities hold:

$$\frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}=\tan{\left(\frac12\sec^{-1}\left(\frac{x+b}{a}\right)\right)}=\frac{\sqrt{x+b-a}}{\sqrt{x+b+a}}=\frac{\sqrt{x+m}}{\sqrt{x+n}},\tag{21}$$

$$e^{\pm\text{i}\alpha}=\tan\left(\frac{1}{2} \csc^{-1}\left(\frac{x+b}{a}\right)\right) = \frac{x + b - \sqrt{(x + b)^2 - a^2}}{a}\tag{22}$$

These identities are generalizations of identities $(1-2)$ and $(9-10)$ and can be proven similarly. The general identities $(21)$ and $(22)$ lead us to the following general transformation formula: 

$$\boxed{\int f\left(x,\tan{\frac{\beta}{2}}, \tan{\frac{\gamma}{2}} \right)\,dx=\int f\left(\frac{e^{i\alpha}+e^{-i\alpha}}{2}a-b, e^{\pm\text{i}\alpha}, \frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}\right)\,\frac{e^{-\text{i}\alpha}-e^{\text{i}\alpha}}{2i}a\,d\alpha}\tag{23}$$

Or

$$\boxed{\int f\left(x, \sqrt{(x+b)^2-a^2}, \frac{\sqrt{x+b-a}}{\sqrt{x+b+a}}\right)\,dx= \int f\left(\frac{e^{i\alpha}+e^{-i\alpha}}{2}a-b, \frac{e^{\mp\text{i}\alpha}-e^{\pm\text{i}\alpha}}{2}a, \frac{1-e^{\pm\text{i}\alpha}}{1+e^{\pm\text{i}\alpha}}\right)\,\frac{e^{-\text{i}\alpha}-e^{\text{i}\alpha}}{2i}a\,d\alpha}\tag{24}$$

Where $\alpha=\cos^{-1}\left(\frac{x+b}{a}\right)$, $\beta=\csc^{-1}\left(\frac{x+b}{a}\right)$ and $\gamma=\sec^{-1}\left(\frac{x+b}{a}\right).$ Use the upper sign for the alternating signs $\mp$ when $\frac{x + b}{a} \geq 1$ and the lower sign when $0 \leq \frac{x + b}{a} \leq 1$.

To illustrate its usefulness, let's look at the following example taken from the YouTube channel Prime Newtons.

Example 11. Evaluate 

$$\int \frac{\sqrt{x+1}}{\sqrt{x+2}}\,dx$$

Solution. First, we obtain the values of $a$ and $b$ by solving the following (simple!) system of equations:

$$\left. b-a=1\atop a+b=2\right\}$$

The solutions are $a = \frac{1}{2}$ and $b = \frac{3}{2}$. Applying formula $(23)$ for $x\geq-1$, the integral becomes

$$\begin{aligned}\int \frac{\sqrt{x+1}}{\sqrt{x+2}}\,dx&= -\frac{i}{4}\int \frac{(1 - e^{i\alpha}) (e^{-i\alpha} - e^{i\alpha})}{(e^{i \alpha} + 1)} \, d\alpha\\&=-\frac{i}{4}\int \frac{e^{-i\alpha} (e^{i\alpha} - 1) (e^{2i\alpha} - 1)}{e^{i\alpha} + 1} \, dx\\&=-\frac{i}{4}\int e^{-i\alpha}(e^{i\alpha}-1)^2\,d\alpha\\&=-\frac{i}{4}\int (e^{-i\alpha}+e^{i\alpha}-2)\,d\alpha\\&=\frac14(2i\alpha+e^{-i\alpha}-e^{i\alpha})+C\end{aligned}$$

To switch to real numbers, plug in the values of $a$ and $b$ into $(22)$ and simplify. Then, replace the expression in the antiderivative from $(22)$ and simplify again. Thus, we obtain

$$=\sqrt{x^2+3x+2} + \frac{1}{2} \ln\left|2x - 2\sqrt{x^2+3x+2} + 3\right|+C$$

On the Prime Newtons YouTube channel, they first perform a variable change, followed by a trigonometric substitution, reducing the integral to integrals involving the secant and secant cubed. This integral calculator uses $u^2 = \frac{x+1}{x+2}$ and then (a complicated) partial fraction decomposition. This can be even more complicated for integral like this one:


where as our method only requires a few lines of algebra and basic calculus, as in Example 11.  

Summary
Here are the most general three transformation formulas presented together:

Transformation for Integrals Involving $\tan\left( \dfrac{\beta}{2} \right)$ and $\tan\left( \dfrac{\gamma}{2} \right)$:

$$\int f\left( x, \tan\left( \dfrac{\beta}{2} \right), \tan\left( \dfrac{\gamma}{2} \right) \right) \, dx = \int f\left( \overbrace{\dfrac{e^{i\alpha} + e^{-i\alpha}}{2}}^{\cos \alpha} a - b, \quad \overbrace{e^{\pm i\alpha}}^{\cos \alpha \pm i \sin \alpha}, \quad \overbrace{\dfrac{1 - e^{\pm i\alpha}}{1 + e^{\pm i\alpha}}}^{i \tan\left( \dfrac{\mp \alpha}{2} \right)} \right) \overbrace{\dfrac{e^{-i\alpha} - e^{i\alpha}}{2i}}^{-\sin \alpha} a \, d\alpha$$

- Where:
  - $a>0$
  - $\alpha = \cos^{-1}\left( \dfrac{x + b}{a} \right)$
  - $\beta = \csc^{-1}\left( \dfrac{x + b}{a} \right)$
  - $\gamma = \sec^{-1}\left( \dfrac{x + b}{a} \right)$
- For the alternating signs $\pm$:
    - Use the upper sign when $\dfrac{x + b}{a} \geq 1$
    - Use the lower sign when $\dfrac{x + b}{a} < -1$
    - Use the lower sign when $0 \leq \dfrac{x + b}{a} \leq 1$ (valid in the complex plane)

Transformation for Integrals Involving $\sqrt{(x + b)^2 - a^2}$ and $\dfrac{\sqrt{x + b - a}}{\sqrt{x + b + a}}$:

$$\int f\left( x, \sqrt{(x + b)^2 - a^2}, \dfrac{ \sqrt{x + b - a} }{ \sqrt{x + b + a} } \right) \, dx = \int f\left( \overbrace{\dfrac{e^{i\alpha} + e^{-i\alpha}}{2}}^{\cos \alpha} a - b, \quad \overbrace{\dfrac{ e^{\mp i\alpha} - e^{\pm i\alpha} }{2}}^{\mp i \sin \alpha} a, \quad \overbrace{\dfrac{1 - e^{\pm i\alpha}}{1 + e^{\pm i\alpha}}}^{i \tan\left( \dfrac{\mp \alpha}{2} \right)} \right) \overbrace{\dfrac{ e^{-i\alpha} - e^{i\alpha} }{2i}}^{-\sin \alpha} a \, d\alpha$$

- Where:
  - $a>0$
  - $\alpha = \cos^{-1}\left( \dfrac{x + b}{a} \right)$
  - For the alternating signs $\mp$ and $\pm$:
    - Use the upper sign when $\dfrac{x + b}{a} \geq 1$
    - Use the lower sign when $\dfrac{x + b}{a} < -1$
    - Use the lower sign when $0 \leq \dfrac{x + b}{a} \leq 1$ (valid in the complex plane)


Transformation for Integrals Involving $\sqrt{(x + b)^2 + a^2}$:

$$\int f\left( x, \sqrt{(x + b)^2 + a^2} \right) \, dx = \int f\left( \overbrace{\dfrac{e^{\theta} - e^{-\theta}}{2}}^{\sinh \theta} a - b, \quad \overbrace{\dfrac{e^{\theta} + e^{-\theta}}{2}}^{\cosh \theta} a \right) \overbrace{\dfrac{e^{\theta} + e^{-\theta}}{2}}^{\cosh \theta} a \, d\theta$$

- Where:
  - $\theta = \sinh^{-1}\left( \dfrac{x + b}{a} \right)$
  - $a > 0$

Advantages of Exponential substitution over trig./hyp. substitutions

1. Unified Approach: Exponential transformations provide a unified approach for dealing with different forms of integrals, whereas trigonometric and hyperbolic substitutions require different strategies for different forms (e.g., \(\sqrt{x^2 - a^2}\) vs. \(\sqrt{a^2 - x^2}\)).

2. Resolving Substitution Dilemmas: It overcomes the dilemmas between choosing trigonometric or hyperbolic substitutions for the same form (see discussion here).

3. Easier to Differentiate and Integrate: Exponential functions have straightforward derivatives and integrals compared to trigonometric and hyperbolic functions, which can simplify the process of differentiation and integration in more complex expressions.

4. Reduction of Trigonometric Identities: Using exponential functions can avoid the need to deal with a plethora of trig./hyp. identities, which can often complicate the integration process.

5. Flexibility in Substitution: It allows for easy switching between exponential and trigonometric forms when convenient, offering flexibility in solving integrals.

6. Versatility with Special Functions: It allows for the simplification and solution of integrals involving special functions like $\tan{\left(\frac12\csc^{-1}(x)\right)}$ and $\tan{\left(\frac12\sec^{-1}(x)\right)}$, which even Wolfram Alpha has trouble solving.

Regarding the originality of this technique, I've asked on Mathoverflow under the title 'Solving 'impossible' integrals with a new (?) trick.' Take a look for yourself.

miércoles, 28 de febrero de 2024

A family of trigonometric formulas for the roots of quadratic equations

 This note presents alternative trigonometric formulas for finding the roots of quadratic equations where $a$, $b$, and $c$ are non-zero real numbers.

Before the era of calculators, trigonometric formulas were favored for computing quadratic roots due to their time and labor-saving benefits. However, it's not advisable nowadays to rely on these formulas over the traditional quadratic formula for root calculations. Nonetheless, the trigonometric formulas showcased in this note have hinted at certain identities that appear useful for integrating trigonometric functions. Thus, the sole purpose of this note is to document the origins of these identities.

Theorem 1. Let $a$, $b$, and $c$ be non-zero real numbers. For the quadratic equation $ax^2+bx+c=0$, the roots are given by:

$$x_{1}=  ie^{i\alpha}\sqrt{\frac{c}{a}}\qquad \text{and}\qquad  x_2=-ie^{-i\alpha}\sqrt{\frac{c}{a}},\tag{1}$$

where $\alpha=\sin^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Consider the quadratic equation $a^2+bx+c=0$. Multiplying both sides by $a$ and making the substitutions $ax=p$ and $ac=q^2$ yields

$$p^2+bp+q^2=0.$$

Let's make the substitution $\sin{\alpha} = \frac{b}{2q}$. Consequently,

$$\begin{aligned}0&=p^2+bp+q^2\\&=p^2+2qp\sin{\alpha}+q^2\\&=p^2\left(\sin^2{\frac{\alpha}{2}}+\cos^2{\frac{\alpha}{2}}\right)+4qp\sin{\frac{\alpha}{2}}\cos{\frac{\alpha}{2}}+q^2\left(\sin^2{\frac{\alpha}{2}}+\cos^2{\frac{\alpha}{2}}\right)\\&=\left(p\sin{\frac{\alpha}{2}}+q\cos{\frac{\alpha}{2}}\right)^2 + \left(p\cos{\frac{\alpha}{2}}+q\sin{\frac{\alpha}{2}}\right)^2\\&=\left(p\sin{\frac{\alpha}{2}}+q\cos{\frac{\alpha}{2}}\right)^2  -i^2\left(p\cos{\frac{\alpha}{2}}+q\sin{\frac{\alpha}{2}}\right)^2 .\end{aligned}$$

Factorizing the difference of squares and then factorizing again, one of the factor of the quadratic equation can be express as follows

$$p\left(\sin{\frac{\alpha}{2}}+i\cos{\frac{\alpha}{2}}\right)+q\left(\cos{\frac{\alpha}{2}}+i\sin{\frac{\alpha}{2}}\right).$$

Setting the factor equal to zero, undoing the substitutions $ax=p$ and $ac=q^2$ and solving for $x$, we obtain 

$$\begin{aligned}x_1&=-\left(\frac{\cos{\frac{\alpha}{2}}+i\sin{\frac{\alpha}{2}}}{\sin{\frac{\alpha}{2}}+i\cos{\frac{\alpha}{2}}}\right)\sqrt{\frac{c}{a}}\\&= -(\sin{\alpha}-i\cos{\alpha})\sqrt{\frac{c}{a}}\\&=ie^{i\alpha}\sqrt{\frac{c}{a}}. \end{aligned}$$

The other factor is given by

$$p\left(\sin{\frac{\alpha}{2}}-i\cos{\frac{\alpha}{2}}\right)+q\left(\cos{\frac{\alpha}{2}}-i\sin{\frac{\alpha}{2}}\right).$$

And similarly,

$$x_2=-ie^{-i\alpha}\sqrt{\frac{c}{a}}.$$ 

Theorem 2. For the quadratic equation $ax^2+bx+c=0$ with non-zero real numbers $a$, $b$, and $c$, the roots are given by:

$$x_{1}=-\tan{\frac{\beta}{2}}\sqrt{\frac{c}{a}}\qquad \text{and} \qquad x_{2}=-\cot{\frac{\beta}{2}}\sqrt{\frac{c}{a}},\tag{2}$$

where $\beta=\csc^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Multiplying by $a$ the quadratic equation $ax^2+bx+c=0$ and then substituting $ax=p$ and $ac=q^2$, we have

$$p^2+bp+q^2=0.$$

Use the substitution $\csc{\beta}=\frac{b}{2q}$, then

$$\begin{aligned}0&=p^2+bp+q^2\\&=p^2+2qp\csc{\beta}+q^2\\&=\csc{\beta}\left(p^2\sin{\beta}+2qp+q^2\sin{\beta}\right)\\&=2p^2\sin{\frac{\beta}{2}}\cos{\frac{\beta}{2}}+2qp\left(\sin^2{\frac{\beta}{2}}+\cos^2{\frac{\beta}{2}}\right)+2q^2\sin{\frac{\beta}{2}}\cos{\frac{\beta}{2}}\\&=p^2\sin{\frac{\beta}{2}}\cos{\frac{\beta}{2}}+qp\sin^2{\frac{\beta}{2}}+ qp\cos^2{\frac{\beta}{2}}+q^2\sin{\frac{\beta}{2}}\cos{\frac{\beta}{2}}\\&= p\sin{\frac{\beta}{2}}\left(p\cos{\frac{\beta}{2}}+q\sin{\frac{\beta}{2}}\right)+q\cos{\frac{\beta}{2}}\left(p\cos{\frac{\beta}{2}}+q\sin{\frac{\beta}{2}}\right)\\&= \left(p\cos{\frac{\beta}{2}}+q\sin{\frac{\beta}{2}}\right)\left(p\sin{\frac{\beta}{2}}+q\cos{\frac{\beta}{2}}\right).\end{aligned}$$

By setting the factors equal to zero, undoing substitutions $ax=p$ and $ac=q^2$ and solving for $x$, we obtain the desired formulas in $(2)$.

Theorem 3. Let $a$, $b$ and $c$ be non-zero real numbers. If $ax^2+bx+c=0$, then the roots are given by:

$$x_{1}=  -e^{i\gamma}\sqrt{\frac{c}{a}}\qquad \text{and}\qquad  x_2=-e^{-i\gamma}\sqrt{\frac{c}{a}},\tag{3}$$

where $\gamma=\cos^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Consider the quadratic equation $ax^2+bx+c=0$. Multiplying both sides by $a$ and substituting $ax=p$ and $ac=q^2$ yields

$$p^2+bp+q^2=0.$$

By making the substitution $\cos{\gamma} = \frac{b}{2q}$, it follows that

$$\begin{aligned}0&=p^2+bp+q^2\\&=p^2+2qp\cos{\gamma}+q^2\\&=p^2\left(\sin^2{\frac{\gamma}{2}}+\cos^2{\frac{\gamma}{2}}\right)+4qp\left(\cos^2{\frac{\gamma}{2}}-\sin^2{\frac{\gamma}{2}}\right)+q^2\left(\sin^2{\frac{\gamma}{2}}+\cos^2{\frac{\gamma}{2}}\right)\\&=\sin^2{\frac{\gamma}{2}} (p-q)^2+\cos^2{\frac{\gamma}{2}}(p+q)^2\\&=\sin^2{\frac{\gamma}{2}} (p-q)^2-i^2\cos^2{\frac{\gamma}{2}}(p+q)^2.\end{aligned}$$

By factoring the difference of squares first and then applying further factorization, one of the factors of the quadratic equation can be represented as follows

$$p\left(\sin{\frac{\gamma}{2}}+i\cos{\frac{\gamma}{2}}\right)+q\left(-\sin{\frac{\gamma}{2}}+i\cos{\frac{\gamma}{2}}\right).$$

Setting the factors equal to zero, undoing substitutions $ax=p$ and $ac=q^2$ and solving for $x$, we obtain

$$\begin{aligned}x_1&=\left(\frac{\sin{\frac{\gamma}{2}}-i\cos{\frac{\gamma}{2}}}{\sin{\frac{\gamma}{2}}+i\cos{\frac{\gamma}{2}}}\right)\sqrt{\frac{c}{a}}\\&= -(\cos{\gamma}+i\sin{\gamma})\sqrt{\frac{c}{a}}\\&=-e^{i\gamma}\sqrt{\frac{c}{a}}.\end{aligned}$$

The other factor is given by

$$p\left(\sin{\frac{\gamma}{2}}-i\cos{\frac{\gamma}{2}}\right)-q\left(\sin{\frac{\gamma}{2}}+i\cos{\frac{\gamma}{2}}\right).$$

And similarly,

$$x_2=-e^{-i\gamma}\sqrt{\frac{c}{a}}.$$

Theorem 4. Let $a$, $b$ and $c$ be non-zero real numbers. If $ax^2+bx+c=0$, then the roots are given by: 

$$x_{1,2}=\frac{\tan{\frac{\delta}{2}\pm1}}{\tan{\frac{\delta}{2}\mp1}}\sqrt{\frac{c}{a}},\tag{4}$$

where $\delta=\sec^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Consider the quadratic equation $ax^2+bx+c=0$. Multiplying both sides by $a$ and substituting $ax=p$ and $ac=q^2$ yields

$$p^2+bp+q^2=0.$$

Use the substitution $\sec{\delta}=\frac{b}{2q}$, then

$$\begin{aligned}0&=p^2+bp+q^2\\&=p^2+2qp\sec{\delta}+q^2\\&=\sec{\delta}\left(p^2\cos{\delta}+2qp+q^2\cos{\delta}\right)\\&=\cos{\delta}(p^2+q^2)+2qp\\&= \cos{\delta}(p+q)^2-2qp\cos{\delta}+2qp\\&= \left(\cos^2{\frac{\delta}{2}}-\sin^2{\frac{\delta}{2}}\right)(p+q)^2-2qp\left(1-2\sin^2{\frac{\delta}{2}}\right)+2qp\\&=  \cos^2{\frac{\delta}{2}}(p+q)^2 -\sin^2{\frac{\delta}{2}}(p+q)^2 +4qp\sin^2{\frac{\delta}{2}}\\&=   \cos^2{\frac{\delta}{2}}(p+q)^2 -\sin^2{\frac{\delta}{2}}\left((p+q)^2 -4qp\right)\\&= \cos^2{\frac{\delta}{2}}(p+q)^2 -\sin^2{\frac{\delta}{2}}(p-q)^2\\&= \left(\cos{\frac{\delta}{2}}(p+q) +\sin{\frac{\delta}{2}}(p-q)\right) \left(\cos{\frac{\delta}{2}}(p+q) -\sin{\frac{\delta}{2}}(p-q)\right).\end{aligned}$$

Expanding and then factorizing again, one of the factors of the quadratic equation is given by

$$p\left(\cos{\frac{\delta}{2}}+\sin{\frac{\delta}{2}}\right)+q\left(\cos{\frac{\delta}{2}}-\sin{\frac{\delta}{2}}\right).$$ 

By setting the factors equal to zero, undoing substitutions $ax=p$ and $ac=q^2$ and solving for $x$, we obtain

$$\begin{aligned}x_1&=\frac{\sin{\frac{\delta}{2}}+\cos{\frac{\delta}{2}}}{\sin{\frac{\delta}{2}}-\cos{\frac{\delta}{2}}}\sqrt{\frac{c}{a}}\\&= \frac{\tan{\frac{\delta}{2}+1}}{\tan{\frac{\delta}{2}-1}}\sqrt{\frac{c}{a}}. \end{aligned}$$

The other factor is given by

$$p\left(\cos{\frac{\delta}{2}}-\sin{\frac{\delta}{2}}\right)+q\left(\cos{\frac{\delta}{2}}+\sin{\frac{\delta}{2}}\right).$$

Similarly, 

$$x_2=\frac{\tan{\frac{\delta}{2}-1}}{\tan{\frac{\delta}{2}+1}}\sqrt{\frac{c}{a}}.$$

Theorem 5. Let $a$, $b$ and $c$ be non-zero real numbers. If $ax^2+bx+c=0$, then the roots are given by:

$$x_{1,2}=\frac{i\pm e^{\eta}}{i\mp e^{\eta}}\sqrt{\frac{c}{a}},\tag{5}$$

where $\eta=\tanh^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Consider the quadratic equation $ax^2+bx+c=0$. Multiplying both sides by $a$ and substituting $ax=p$ and $ac=q^2$ yields

$$p^2+bp+q^2=0.$$

Use the substitution $\tanh{\eta}=\frac{b}{2q}$, then

$$\begin{aligned}0&=p^2+bp+q^2\\&=p^2+2qp\tanh{\eta}+q^2\\&=(e^{2\eta} + 1) p^2 + 2 (e^{2\eta} - 1) p q + (e^{2\eta} + 1) q^2\\&=e^{2\eta}(p + q)^2 + (p - q)^2\\&=e^{2\eta}(p + q)^2 - i^2(p - q)^2 \\&=(e^{\eta}p + i p + e^{\eta}q - i q)(e^{\eta}p - i p + e^{\eta}q + i q)\\&= \left(p(e^{\eta} + i) + q(e^{\eta} - i)\right)\left(p(e^{\eta} - i) + q(e^{\eta} + i)\right)\end{aligned}$$

Setting the factor equal to zero, undoing the substitutions $ax=p$ and $ac=q^2$ and solving for $x$, we obtain 

$$x_{1}=\frac{i- e^{\eta}}{i+e^{\eta}}\sqrt{\frac{c}{a}}.$$

And similarly,

$$x_{2}=\frac{i+ e^{\eta}}{i-e^{\eta}}\sqrt{\frac{c}{a}}.$$

Theorem 6. Let $a$, $b$ and $c$ be non-zero real numbers. If $ax^2+bx+c=0$, then the roots are given by:

$$x_{1,2}=\frac{1\pm e^{\theta}}{1\mp e^{\theta}}\sqrt{\frac{c}{a}},\tag{6}$$

where $\theta=\coth^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Consider the quadratic equation $ax^2+bx+c=0$. Multiplying both sides by $a$ and substituting $ax=p$ and $ac=q^2$ yields

$$p^2+bp+q^2=0.$$

Use the substitution $\coth{\theta}=\frac{b}{2q}$, Then, similar to how we proceeded previously,

$$\begin{aligned}0&=p^2+bp+q^2\\&=p^2+2qp\coth{\theta}+q^2\\&=(e^{2\theta} - 1) p^2 + 2 (e^{2\theta} + 1) p q + (e^{2\theta} - 1) q^2\\&=e^{2\theta}(p + q)^2 - (p - q)^2 \\&=\left( p e^{\theta} + p + q e^{\theta} - q \right) \left( p e^{\theta} - p + q e^{\theta} + q \right)\\&=\left(p(e^x + 1) + q(e^x - 1)\right)\left(p (e^x - 1) + q (e^x + 1)\right)\end{aligned}$$

Setting the factor equal to zero, undoing the substitutions $ax=p$ and $ac=q^2$ and solving for $x$, we obtain 

$$x_{1}=\frac{1- e^{\theta}}{1+e^{\theta}}\sqrt{\frac{c}{a}}= -\tanh\left(\frac{1}{2} \text{coth}^{-1}(x)\right)\sqrt{\frac{c}{a}}.$$

And similarly,

$$x_{2}=\frac{1+ e^{\theta}}{1-e^{\theta}}\sqrt{\frac{c}{a}}.$$

jueves, 15 de febrero de 2024

Integrals yielding $e^{\pi}$ or $e^{-\pi}$

 Lately, I've been playing a lot with integrals, and coincidentally (with a bit of algebraic manipulation), I've come across these two beauties:

$$\int_{0}^{1} \left(\frac{5}{2} \left((x - \sqrt{x^2 - 1})^{2i} + x^4\right) - 1\right) \, dx = e^{\pi},\tag{1}$$

$$\int_{0}^{1} \left( -\frac{5}{2\left( x - \sqrt{x^2 - 1}\right)^{2i}} - \frac{5x^4}{2} + 1 \right) \, dx = e^{-\pi}.\tag{2}$$

$e^{\pi}$ is known as Gelfond's constant.

I have provided these integrals as a response to a question on MathSE. The proofs are left as exercises for the reader.


miércoles, 7 de febrero de 2024

Solving 'impossible' integrals with a new trick

"Complexification formulas are great and it seems like this simplifies the right away."
Ninad Munshi

The following identities have been suggested based on formulas in a previous question of mine.

If complex $\theta_1=\cos^{-1}(p)$ and $\theta_2=\sec^{-1}(p)$, where $p\in(-1, 0) \cup (1, \infty)$, then the following relation holds:

$$e^{i\theta_1}=\frac{1-\tan\frac{\theta_2}{2} }{1+\tan\frac{\theta_2}{2}}.
\tag{1}\label{463459_1}$$

And for $p\in(-\infty, -1)\cup (0, 1)$, we have

$$e^{-i\theta_1}=\frac{1-\tan\frac{\theta_2}{2} }{1+\tan\frac{\theta_2}{2}}. \tag{2}\label{463459_2}$$

If complex $\theta_1=\sin^{-1}(p)$ and $\theta_2=\csc^{-1}(p)$, where $p\in(-\infty, -1)\cup (0, 1)$, then the following relation holds:

$$ie^{i\theta_1}=-\tan\frac{\theta_2}{2}.\tag{3}\label{463459_3}$$

And for $p\in(-1, 0) \cup (1, \infty)$ we have

$$ie^{-i\theta_1}=\tan\frac{\theta_2}{2}.\tag{4}\label{463459_4}$$

There are several variants that we can obtain by equating (and simplifying) the trigonometric formulas for quadratic equations from my previous question.

I have noticed that for certain trigonometric integrals defined over permissible intervals of $p$, the evaluation simplifies considerably. For instance, consider the following definite integral:

$$\int_2^5 \sqrt{\tan\left(\frac{\csc^{-1}(x)}{2}\right)} \,dx.\tag{5}$$

This integral calculator returns the following (although Wolfram Alpha solves it):

No antiderivative could be found within the given time limit, or all supported integration methods were tried unsuccessfully. Note that many functions don't have an elementary antiderivative.

But it gives an approximation of $1.178881841955109.$

Given that the interval $[2, 5]$ is within the permissible values of $p$, we can use $e^{i\cos^{-1}(p)}=\tan\frac{\csc^{-1}(p)}{2}$ (derived from identities $(1)$ and $(4)$, valid for $p\in[-1, 0) \cup [1, \infty)$, to convert $(5)$ into

$$\int_2^5 \sqrt{e^{i\cos^{-1}(x)}}\,dx.\tag{6}$$

The same calculator provides the same answer but now displaying the steps as well. As a second example, Mathematica  is unable to solve this integral:

$$\int_{2}^{3}  \frac{{1 - \tan\frac{{\sec^{-1}x}}{2}}}{{1 + \tan\frac{{\sec^{-1}x}}{2}}}\sqrt{\tan\frac{\csc^{-1}x}{2}}\,dx\tag{7}$$

Neither this integral calculator. Although both the calculator and Wolfram Alpha can give you a numerical approximation. However, thanks to this new trick, you can convert $(7)$ into

$$\int_{2}^{3} e^{\frac{3i\arccos(x)}{2}}\,dx\tag{8}$$

Note that this integral calculator has no problem solving (elegantly!) integral $(8)$.

Other examples of integrals that at least Wolfram Alpha is not capable of solving but that can be evaluated using the transformations described in this blog (each integral is linked to its solution in the integral calculator):




So far I have considered integrals involving $\tan{\left(\frac12\csc^{-1}x\right)}$. However, this technique can be applied to a countless number of cases that surpass my initial expectations. For example, consider the integral $\int_{\frac{\pi}{4}}^{\frac{\pi}{20}}\sqrt{\tan{x}}\,dx$. This can be solved by letting $x=\frac12\csc^{-1}t$, where $\,dx=-\frac{1}{2t\sqrt{t^2-1}}\,dt$, transforming the original integral into $-\frac12\int_{\csc(\frac{\pi}{2})}^{\csc(\frac{\pi}{10})}e^{\frac12i\arccos(t)} \left(\frac{1}{t\sqrt{t^2-1}}\right) \, dt$. Certainly, there will be instances where employing these transformations might seem overly intricate, akin to cutting bread with a saw. However, what I aim to emphasize is the remarkable versatility of this technique.

Related material

sábado, 13 de enero de 2024

Trigonometric formula for solving quadratic equations

In this note, we provide an alternative trigonometric formula for solving quadratic equations where $a$, $b$, and $c$ are non-zero real numbers.

If $ax^2+bx+c=0$, then 
$$x_{1,2}=\left(1\pm\frac{2}{\tan{\frac{\theta}{2}\mp1}}\right)\sqrt{\frac{c}{a}},$$

where $\theta=\sec^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$.

Proof. Multiplying by $a$ the quadratic equation we have

$$(ax)^2+b(ax)+ac=0.$$

Let's make the substitution $\sec{\theta}=\frac{b}{2\sqrt{ac}}$, then

$$\begin{aligned}0&=(ax)^2+b(ax)+ac\\&=(ax)^2+2\sqrt{ac}(ax)\sec{\theta}+ac\\&=\sec{\theta}\left((ax)^2\cos{\theta}+2\sqrt{ac}(ax)+ac\cos{\theta}\right)\\&=\cos{\theta}((ax)^2+ac)+2\sqrt{ac}(ax)\\&= \cos{\theta}(ax+\sqrt{ac})^2-2\sqrt{ac}(ax)\cos{\theta}+2\sqrt{ac}(ax)\\&= \left(\cos^2{\frac{\theta}{2}}-\sin^2{\frac{\theta}{2}}\right)(ax+\sqrt{ac})^2-2\sqrt{ac}(ax)\left(1-2\sin^2{\frac{\theta}{2}}\right)+2\sqrt{ac}(ax)\\&=  \cos^2{\frac{\theta}{2}}(ax+\sqrt{ac})^2 -\sin^2{\frac{\theta}{2}}(ax+\sqrt{ac})^2 +4\sqrt{ac}(ax)\sin^2{\frac{\theta}{2}}\\&=   \cos^2{\frac{\theta}{2}}(ax+\sqrt{ac})^2 -\sin^2{\frac{\theta}{2}}\left((ax+\sqrt{ac})^2 -4\sqrt{ac}(ax)\right)\\&= \cos^2{\frac{\theta}{2}}(ax+\sqrt{ac})^2 -\sin^2{\frac{\theta}{2}}(ax-\sqrt{ac})^2\\&= \left(\cos{\frac{\theta}{2}}(ax+\sqrt{ac}) +\sin{\frac{\theta}{2}}(ax-\sqrt{ac})\right) \left(\cos{\frac{\theta}{2}}(ax+\sqrt{ac}) -\sin{\frac{\theta}{2}}(ax-\sqrt{ac})\right)\\&=\left(ax\left(\cos{\frac{\theta}{2}}+\sin{\frac{\theta}{2}}\right)+\sqrt{ac}\left(\cos{\frac{\theta}{2}}-\sin{\frac{\theta}{2}}\right)  \right) \left(ax\left(\cos{\frac{\theta}{2}}-\sin{\frac{\theta}{2}}\right)+\sqrt{ac}\left(\cos{\frac{\theta}{2}}+\sin{\frac{\theta}{2}}\right)  \right).\end{aligned}$$

Now, by setting the factors equal to zero and solving for x, we obtain,

$$\begin{aligned}x_1&=\left(\frac{\sin{\frac{\theta}{2}}+\cos{\frac{\theta}{2}}}{\sin{\frac{\theta}{2}}-\cos{\frac{\theta}{2}}}\right)\sqrt{\frac{c}{a}}\\&= \left(1+\frac{2}{\tan{\frac{\theta}{2}-1}}\right)\sqrt{\frac{c}{a}}. \end{aligned}$$

Similarly we obtain, 

$$\begin{aligned}x_2= \left(1-\frac{2}{\tan{\frac{\theta}{2}+1}}\right)\sqrt{\frac{c}{a}} \end{aligned}.$$

$\square$

The formula appears to be new, at least on the internet. Wikipedia presents a trigonometric method, but it is different from mine. Stuart Simons offers a method that does seem to be related to my approach, but he only provides direct formulas for complex roots. I was able to independently derive Simons' formulas using $\cos{\theta}$ in the substitution instead of $\sec{\theta}$, and this was before coming across the Wikipedia article that references Simons' paper: Simons, Stuart, 'Alternative approach to complex roots of real quadratic equations,' Mathematical Gazette 93, March 2009, 91–92.

More discussion about this formula can be found on the MathSE forum.

RemarkThe half-angle formulas are ubiquitous, and this alternative formula for quadratic equations is another piece of evidence for that.

jueves, 4 de enero de 2024

A generalization of Burlet's theorem to cyclic quadrilaterals

 The Burlet's theorem is a result in Euclidean geometry, which can be formulated as follows:

Theorem 1. Consider triangle $ABC$ with $\angle{BCA}=\gamma$. Let $P$ be the point where the incircle touches side $AB$, and denote the lengths $AP$ and $BP$ as $m$ and $n$, respectively. Then

$$\Delta_0=mn\cot{\frac{\gamma}{2}},\tag{1}$$

A triangle $ABC$ with $AP=m$ and $BP=n$.


where $\Delta_0$ denotes the area of $ABC$. Note that when $\gamma=\frac{\pi}{2}$, then $\Delta_0=mn$.

We adopt unconventional notation to reduce the relation of Theorem 2 into the one referenced in $(1)$. Additionally, we denote $s$ the semiperimeter, applicable to both triangles and cyclic quadrilaterals.

Proof. Let $AB=a$, $BC=b$ and $AC=c$. By Heron's formula, we have

$$\begin{aligned}\Delta_0&=\sqrt{s(s-a)(s-b)(s-c)}\\&=\sqrt{s(s-a)(s-b)(s-c)}\color{red}{\sqrt{\frac{(s-b)(s-c)}{(s-b)(s-c)}}}\\&=(s-b)(s-c)\sqrt{\frac{s(s-a)}{(s-b)(s-c)}}.\end{aligned}$$

However, using half-angle formulas for a triangle, we can express $\cot{\frac{\gamma}{2}}$ as $\sqrt{\frac{s(s-a)}{(s-b)(s-c)}}$, where $m=(s-b)$ and $n=(s-c)$. This establishes the relationship mentioned in $(1)$.

$\square$

Theorem 2 (Generalization). Consider a cyclic quadrilateral $ABCD$ with side lengths $AB=a$, $BC=b$, $CD=c$, and $DA=d$. Additionally, let $\angle DAB = \alpha$. In this context, the following relation is valid:

$$\Delta_1=(s-a)(s-d)\cot{\frac{\alpha}{2}},\tag{2}$$

A cyclic quadrilateral $ABCD$.

where $\Delta_1$ denotes the area of $ABCD$.

Proof. Similar to how we proceeded in theorem 1, using the Brahmagupta's formula, we have

$$\begin{aligned}\Delta_1&=\sqrt{(s-a)(s-b)(s-c)(s-d)}\\&=\sqrt{(s-a)(s-b)(s-c)(s-d)}\color{red}{\sqrt{\frac{(s-a)(s-d)}{(s-a)(s-d)}}}\\&=(s-a)(s-d)\sqrt{\frac{(s-b)(s-c)}{(s-a)(s-d)}}.\end{aligned}$$

Now, invoking the half-angle formulas for cyclic quadrilaterals, we have that $\cot{\frac{\alpha}{2}}=\sqrt{\frac{(s-b)(s-c)}{(s-a)(s-d)}}$, from which the relation $(2)$ is deduced.

$\square$

Let $\angle{BCD}=\gamma$ and assume that $d=0$. We have that $\alpha=\pi-\gamma$, so substituting in $(2)$, 

When $d=0$, by the alternate segment theorem, $\alpha=\pi-\gamma$.

$$\begin{aligned}\Delta_1&=(s-a)(s-0)\cot{\left(\frac{\pi-\gamma}{2}\right)}\\&=s(s-a)\tan{\frac{\gamma}{2}}\\&=s(s-a)\sqrt{\frac{(s-b)(s-c)}{s(s-a)}}\color{red}{\sqrt{\frac{(s-b)(s-c)}{(s-b)(s-c)}}}\\&=(s-b)(s-c)\sqrt{\frac{s(s-a)}{(s-b)(s-c)}}\\&=(s-b)(s-c)\cot{\frac{\gamma}{2}},\end{aligned}$$

which is Burlet's theorem for a triangle since $m=(s-b)$ and $n=(s-c)$.

RemarkA. Burlet (Dublin) presented this theorem as a problem in the Nouvelles annales de mathématiques, Vol. 15, 1856, p. 290. Consequently, the theorem might have derived its name from him.