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 and $ac>0$. Throughout this note, we write $q=\sqrt{ac}>0$ and use the signed scale $\kappa=\frac{q}{a}=\frac{\sqrt{ac}}{a}$. Notice that $\kappa^2=c/a$, but if $a<0$ and $c<0$, then $\kappa=-\sqrt{c/a}$ when $\sqrt{c/a}$ denotes the principal positive square root. Thus the formulas below use $\kappa$, not $\sqrt{c/a}$, unless the equation has first been multiplied by $-1$ so that $a>0$ and $c>0$.

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 irrational functions. Thus, the sole purpose of this note is to document the origins of these identities.

In the formulas presented, we assume $ac>0$, so that $\sqrt{ac}$ is real and non-zero. Each inverse trigonometric or hyperbolic function assumes real values only when its argument lies in the corresponding real domain. Specifically:

For definiteness, $\sin^{-1}$ and $\cos^{-1}$ denote their standard principal real branches, $\csc^{-1}y$ is taken in $[-\pi/2,0)\cup(0,\pi/2]$, and $\sec^{-1}y$ is taken in $[0,\pi]\setminus{\pi/2}$.

$\alpha = \sin^{-1}\left(\frac{b}{2\sqrt{ac}}\right)$ and $\gamma = \cos^{-1}\left(\frac{b}{2\sqrt{ac}}\right)$ are real-valued if and only if 

$$\left|\frac{b}{2\sqrt{ac}}\right|\;\le\;1.$$

$\beta = \csc^{-1}\left(\frac{b}{2\sqrt{ac}}\right)$ and $\delta = \sec^{-1}\left(\tfrac{b}{2\sqrt{ac}}\right)$ are real-valued if and only if 

$$\left|\frac{b}{2\sqrt{ac}}\right|\;\ge\;1.$$

$\eta = \tanh^{-1}\left(\frac{b}{2\sqrt{ac}}\right)$ is real-valued if and only if 

$$\left|\frac{b}{2\sqrt{ac}}\right|\;<\;1.$$

$\theta = \coth^{-1}\left(\frac{b}{2\sqrt{ac}}\right)$ is real-valued if and only if 

$$\left|\frac{b}{2\sqrt{ac}}\right|\;>\;1.$$

Consequently, each theorem in this note presumes $ac>0$ and that \(b/(2\sqrt{ac})\) lies within the necessary interval so that the stated inverse trigonometric or hyperbolic expression remains real-valued. If one allows complex-valued functions, these real-domain restrictions can be relaxed only after explicit branches for the square root, logarithm, and inverse trigonometric or hyperbolic functions have been fixed.

Theorem 1. Let $a$, $b$, and $c$ be non-zero real numbers with $ac>0$ and $\left|\frac{b}{2\sqrt{ac}}\right|\le 1$. For the quadratic equation $ax^2+bx+c=0$, the roots are given by:

$$x_{1}=  ie^{i\alpha}\kappa\qquad \text{and}\qquad  x_2=-ie^{-i\alpha}\kappa,\tag{1}$$

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

Proof. Consider the quadratic equation $ax^2+bx+c=0$. Multiplying both sides by $a$ and making the substitutions $ax=p$ and $q=\sqrt{ac}$ 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 $q=\sqrt{ac}$ 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)\kappa\\&= -(\sin{\alpha}-i\cos{\alpha})\kappa\\&=ie^{i\alpha}\kappa. \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}\kappa.$$ 

Theorem 2. For the quadratic equation $ax^2+bx+c=0$ with non-zero real numbers $a$, $b$, and $c$, $ac>0$, and $\left|\frac{b}{2\sqrt{ac}}\right|\ge 1$, the roots are given by:

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

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

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

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

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

$$p^2+2qp\csc{\beta}+q^2=0.$$

Since $\sin\beta\ne0$, multiplying this equation by $\frac12\sin\beta$ gives

$$\begin{aligned}0&=\frac12(p^2+q^2)\sin\beta+qp\\&=p^2\sin{\frac{\beta}{2}}\cos{\frac{\beta}{2}}+qp\left(\sin^2{\frac{\beta}{2}}+\cos^2{\frac{\beta}{2}}\right)+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 $q=\sqrt{ac}$ and solving for $x$, we obtain the desired formulas in $(2)$.

Remark. We acknowledge that formulas similar to those presented in Theorem 2 were previously obtained in the work titled Lehrbuch der Gleichungen des II. Grades (Quadratische Gleichungen).

Theorem 3. Let $a$, $b$ and $c$ be non-zero real numbers with $ac>0$ and $\left|\frac{b}{2\sqrt{ac}}\right|\le 1$. If $ax^2+bx+c=0$, then the roots are given by:

$$x_{1}=  -e^{i\gamma}\kappa\qquad \text{and}\qquad  x_2=-e^{-i\gamma}\kappa,\tag{3}$$

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

Proof. Consider the quadratic equation $ax^2+bx+c=0$. Multiplying both sides by $a$ and substituting $ax=p$ and $q=\sqrt{ac}$ 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)+2qp\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 $q=\sqrt{ac}$ 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)\kappa\\&= -(\cos{\gamma}+i\sin{\gamma})\kappa\\&=-e^{i\gamma}\kappa.\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}\kappa.$$

Remark. Similar formulas to those in Theorem 3 were obtained in the paper: Simons, Stuart, “Alternative approach to complex roots of real quadratic equations,” Mathematical Gazette 93, March 2009, 91–92.

Theorem 4. Let $a$, $b$ and $c$ be non-zero real numbers with $ac>0$ and $\left|\frac{b}{2\sqrt{ac}}\right|\ge 1$. If $ax^2+bx+c=0$, then the roots are given by: 

$$x_1=\frac{\sin{\frac{\delta}{2}}+\cos{\frac{\delta}{2}}}{\sin{\frac{\delta}{2}}-\cos{\frac{\delta}{2}}}\kappa\qquad \text{and}\qquad x_2=\frac{\sin{\frac{\delta}{2}}-\cos{\frac{\delta}{2}}}{\sin{\frac{\delta}{2}}+\cos{\frac{\delta}{2}}}\kappa.\tag{4}$$

Where $\delta=\sec^{-1}{\left(\frac{b}{2\sqrt{ac}}\right)}$ and $\kappa=\frac{\sqrt{ac}}{a}$. When $\delta\ne\pi$, formula $(4)$ may equivalently be written as $x_{1,2}=\frac{\tan(\delta/2)\pm1}{\tan(\delta/2)\mp1}\kappa$. At $b/(2\sqrt{ac})=-1$, one has $\delta=\pi$ on the stated real branch, and $(4)$ gives the repeated root directly.

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

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

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

$$p^2+2qp\sec{\delta}+q^2=0.$$

Since $\cos\delta\ne0$, multiplying this equation by $\cos\delta$ gives

$$\begin{aligned}0&=\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 $q=\sqrt{ac}$ and solving for $x$, we obtain

$$x_1=\frac{\sin{\frac{\delta}{2}}+\cos{\frac{\delta}{2}}}{\sin{\frac{\delta}{2}}-\cos{\frac{\delta}{2}}}\kappa.$$

When $\delta\ne\pi$, division of numerator and denominator by $\cos(\delta/2)$ also gives

$$x_1=\frac{\tan(\delta/2)+1}{\tan(\delta/2)-1}\kappa.$$

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{\sin{\frac{\delta}{2}}-\cos{\frac{\delta}{2}}}{\sin{\frac{\delta}{2}}+\cos{\frac{\delta}{2}}}\kappa.$$

For $\delta\ne\pi$, this is equivalently

$$x_2=\frac{\tan(\delta/2)-1}{\tan(\delta/2)+1}\kappa.$$

Theorem 5. Let $a$, $b$ and $c$ be non-zero real numbers with $ac>0$ and $\left|\frac{b}{2\sqrt{ac}}\right|<1$. If $ax^2+bx+c=0$, then the roots are given by:

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

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

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

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

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

$$p^2+2qp\tanh{\eta}+q^2=0.$$

Multiplying this equation by the non-zero factor $e^{2\eta}+1$ gives

$$\begin{aligned}0&=(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 $q=\sqrt{ac}$ and solving for $x$, we obtain 

$$x_{1}=\frac{i- e^{\eta}}{i+e^{\eta}}\kappa.$$

And similarly,

$$x_{2}=\frac{i+ e^{\eta}}{i-e^{\eta}}\kappa.$$

Theorem 6. Let $a$, $b$ and $c$ be non-zero real numbers with $ac>0$ and $\left|\frac{b}{2\sqrt{ac}}\right|>1$. If $ax^2+bx+c=0$, then the roots are given by:

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

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

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

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

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

$$p^2+2qp\coth{\theta}+q^2=0.$$

Multiplying this equation by the non-zero factor $e^{2\theta}-1$ gives

$$\begin{aligned}0&=(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^{\theta} + 1) + q(e^{\theta} - 1)\right)\left(p (e^{\theta} - 1) + q (e^{\theta} + 1)\right).\end{aligned}$$

Setting the factor equal to zero, undoing the substitutions $ax=p$ and $q=\sqrt{ac}$ and solving for $x$, we obtain 

$$x_{1}=\frac{1- e^{\theta}}{1+e^{\theta}}\kappa.$$

And similarly,

$$x_{2}=\frac{1+ e^{\theta}}{1-e^{\theta}}\kappa.$$

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.