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