光的世界︰派生科學計算二‧上

為什麼『IPython』那麼強調『互動性』 interactive 呢?因為人們的『認知』是積累的,偶或『靈感』乍現,當下若不『捕捉』,恐怕稍後不復『記得』矣!更何況今日之『計算』極其『複雜』,若是每每紙筆『推導』,或是一定得先寫好『程式』,總覺不切實際,終將誰願為的耶??反觀則朗朗親見『互動性』伴隨『符號運算』的好處??!!

口說無憑,且以拉格朗日之『預解形‧式』再探伽羅瓦『方程式』論的淵源,及於『SymPy』之省勞少錯方便乎!!??

Permutations_RGB.svg

220px-15-Puzzle

220px-Symmetric_group_3;_Cayley_table;_matrices.svg

220px-Permutations_with_repetition.svg

就讓我們略窺一下『伽羅瓦』的思考法吧。假使 x_1,x_2,\cdots, x_n 是『多項式P(x) = \sum \limits_{k=0}^{k=n} c_k x^k = 0 的『』,此處係數 c_k 都是『有理數』。如果我們建構一個『對稱函數

f(x_1,x_2,x_3,\cdots,x_n) = (x-x_1)(x-x_2)(x-x_3)\cdots(x-x_n)

,將它展開後 c_n f(x_1,x_2,x_3,\cdots,x_n) 應該就是 P(x) 的吧。如果將這些『x_1,x_2,\cdots, x_n,作任意的『排列』permutation \begin{pmatrix} x_1 & x_2 & x_3 & \cdots & x_n \\ x_2 & x_n & x_4 & \cdots & x_1\end{pmatrix},此處是說上一排的『』的『位置』用下一排的『』來『置換』,由於 f 函數的特殊『形式』,我們會得到 f(x_1,x_2,x_3, \cdots,x_n)=f(x_2,x_n,x_4,\cdots,x_1)。事實上對於任意的『置換』,都會有 f(x_1,x_2,...,x_n)=f(x_2,x_1,\cdots,x_n)=f(x_3,x_1,\cdots,x_n,x_{n−1})。所以函數 f 稱之為『對稱函數』,這個『置換』的『不變性』就是『伽羅瓦』 主要研究的對象。舉例來說,考慮一個二次方程式 x^2 + A x + B = 0 有兩個根 \lambda_1, \lambda_2F(\lambda_1, \lambda_2) = (x - \lambda_1)(x - \lambda_2)
= x^2 -(\lambda_1 + \lambda_2) x +  \lambda_1 \cdot \lambda_2
= x^2 + A x + B
,比對後得到
\lambda_1 + \lambda_2 = -A,和
\lambda_1 \cdot \lambda_2 = B
。這兩個『代數式』對於 \lambda_1, \lambda_2 來講,也是『對稱的』,如果將它們看成兩個變數的『聯立方程組』,化簡後所得到的也定然就是『對等的』二次方程式 {\lambda_1}^2 + A \lambda_1 + B = 0{\lambda_2}^2 + A \lambda_2 + B = 0

這產生了很重要的結果,假使 \lambda_1 = a + b \sqrt{Q} 是方程式的一個根,假設另一個根是 \lambda_2 = c + d \sqrt{Q},由於
\lambda_1 + \lambda_2 = -A
\Longrightarrow  (a + b \sqrt{Q}) + (c + d \sqrt{Q}) = -A
\Longrightarrow  (a + c +A) + (b + d) \sqrt{Q} = 0
\therefore a + c + A = 0, \ b + d =0
,再由
\lambda_1 \cdot \lambda_2 = B
\Longrightarrow  (a + b \sqrt{Q}) \cdot (c + d \sqrt{Q}) = B
\Longrightarrow (a c + b d Q - B) + (a d + b c) \sqrt{Q}) =0
\therefore a c + b d Q = B, \ a d + b c =0
。因此得到 d = -b, \ c = a。而且 a = - \frac{A}{2}, \ b \sqrt{Q} = \frac{\sqrt{A^2 - 4B}}{2}。也就是說這兩個根是熟悉的 \frac{- A + \sqrt{A^2 - 4B}}{2}\frac{- A - \sqrt{A^2 - 4B}}{2}。於是一個『對稱函數f(x_1,x_2,x_3,\cdots,x_n) = (x-x_1)(x-x_2)(x-x_3)\cdots(x-x_n) 如果某一個根 x_ka + b \sqrt{Q} 的形式﹐那麼必然有另一個根 x_ja - b \sqrt{Q} 的形式,這就是由於那個『多項式』的係數是『有理數』的原故,它的『二次方根』的解,總是『成對』出現的啊!於是『二次方根』解的個數也必然是『偶數』的了!!

── 摘自《【Sonic π】電路學之補充《四》無窮小算術‧中下下‧中

Resolvent (Galois theory)

In Galois theory, a discipline within the field of abstract algebra, a resolvent for a permutation group G is a polynomial whose coefficients depend polynomially on the coefficients of a given polynomial p and has, roughly speaking, a rational root if and only if the Galois group of p is included in G. More exactly, if the Galois group is included in G, then the resolvent has a rational root, and the converse is true if the rational root is a simple root. Resolvents were introduced by Joseph Louis Lagrange and systematically used by Évariste Galois. Nowadays they are still a fundamental tool to compute Galois groups. The simplest examples of resolvents are

These three resolvents have the property of being always separable, which means that, if they have a multiple root, then the polynomial p is not irreducible. It is not known if there is an always separable resolvent for every group of permutations.

For every equation the roots may be expressed in terms of radicals and of a root of a resolvent for a resoluble group, because, the Galois group of the equation over the field generated by this root is resoluble.

───

 

即使祇以文獻上記載的歷史來說,

配方法

配方法是一種代數的計算技巧,可以用來解二次方程式、判別解析幾何中某些方程式的圖形,或者用來計算微積分中的某些積分型式。配方法最主要的目的就是將一個一元二次方程式多項式化為一個一次式的完全平方,以便簡化計算。

將下方左邊的二次式化成右邊的形式,就是配方法的目標:

{\displaystyle ax^{2}+bx+c=a(x-h)^{2}+k} ,其中h和k是常數

 

其由來亦古早矣︰

求根公式的由來

中亞細亞花拉子米

花拉子米全名是阿布·阿卜杜拉·穆罕默德·伊本·穆薩·花拉子米[1]Abū ʿAbdallāh Muḥammad ibn Mūsā al-Khwārizmī,約780年-約850年[2]),他是一位波斯數學家、天文學家及地理學家,也是巴格達智慧之家的學者。

他的《代數學》(Kitab al-Jabr wa-l-Muqabala)是第一本解決一次方程一元二次方程的系統著作,他因而被稱為代數的創造者[3],與丟番圖享名。十二世紀,花拉子米在印度數字方面的著作被翻譯成拉丁文,十進制因此傳入西方世界[4]。此外,他修訂了托勒密的《地理》,並著有天文學及占星學方面的書籍。

從一些詞就可以看出他對數學的重要貢獻,「代數」(algebra)一詞出自阿拉伯文拉丁轉寫「al-jabr」[5],「al-jabr」是用以解決一元二次方程的兩個辦法之一。算法(Algorism、Algorithm)出自「Algoritmi」,這是花拉子米(al-Khwārizmī)的拉丁文譯名[6],而西班牙語「guarismo」及葡萄牙語「algarismo」亦是由此名字而來,這兩個詞語都解作數字[7]

……

(約780-約850) 在公元820年左右出版了《代數學》。書中給出了一元二次方程的求根公式,並把方程的未知數叫做「根」,其後譯成拉丁文radix

我們通常把  x={\frac {-b\pm {\sqrt {b^{2}-4ac}}}{2a}} 稱之為 ax^{2}+bx+c=0\, 的求根公式:

{\begin{aligned}ax^{2}+bx+c&=0\\x^{2}+{\frac {b}{a}}x+{\frac {c}{a}}&=0\\x^{2}+{\frac {b}{a}}x+\left({\frac {b}{2a}}\right)^{2}-\left({\frac {b}{2a}}\right)^{2}+{\frac {c}{a}}&=0\\\left(x+{\frac {b}{2a}}\right)^{2}-{\frac {b^{2}}{4a^{2}}}+{\frac {c}{a}}&=0\\\left(x+{\frac {b}{2a}}\right)^{2}&={\frac {b^{2}}{4a^{2}}}-{\frac {c}{a}}\\\left(x+{\frac {b}{2a}}\right)^{2}&={\frac {b^{2}-4ac}{4a^{2}}}\\x+{\frac {b}{2a}}&={\frac {\pm {\sqrt {b^{2}-4ac}}}{2a}}\\x&={\frac {-b\pm {\sqrt {b^{2}-4ac}}}{2a}}\end{aligned}}

 

或不將  x^{2}係數化為1:

{\begin{aligned}ax^{2}+bx+c&=0\\ax^{2}+bx+\left({\frac {b}{2{\sqrt {a}}}}\right)^{2}&=\left({\frac {b}{2{\sqrt {a}}}}\right)^{2}-c\\\left(x{\sqrt {a}}+{\frac {b}{2{\sqrt {a}}}}\right)^{2}&=\left({\frac {b}{2{\sqrt {a}}}}\right)^{2}-c\\x{\sqrt {a}}+{\frac {b}{2{\sqrt {a}}}}&=\pm {\sqrt {\left({\frac {b}{2{\sqrt {a}}}}\right)^{2}-c}}\\x{\sqrt {a}}+{\frac {b}{2{\sqrt {a}}}}&=\pm {\sqrt {{\frac {b^{2}}{4a}}-c}}\\x+{\frac {b}{2a}}&=\pm {\sqrt {{\frac {b^{2}}{4a^{2}}}-{\frac {c}{a}}}}\\x+{\frac {b}{2a}}&=\pm {\sqrt {{\frac {b^{2}}{4a^{2}}}-{\frac {4ac}{4a^{2}}}}}\\x&=-{\frac {b}{2a}}\pm {\sqrt {{\frac {b^{2}-4ac}{4a^{2}}}}}\\x&={\frac {-b\pm {\sqrt {b^{2}-4ac}}}{2a}}\end{aligned}}

 

至於說用『單位圓』之

單位根

數學上, n\,次單位根 } n\,次冪為1的複數。它們位於複平面的單位圓上,構成n邊形頂點,其中一個頂點是1。

定義

  z^{n}=1\qquad (n=1,2,3,\cdots )

這方程的複數根 z \,  n\,次單位根

單位的  n\,次根有  n\,個:

{\displaystyle e^{\frac {2\pi k{i}}{n}}\qquad (k=0,1,2,\cdots ,n-1)}

本原根

單位的  n\,次根以乘法構成 n循環群。它的生成元是  n\,本原單位根。n\,次本原單位根是 {\displaystyle e^{\frac {2\pi k{i}}{n}}},其中 k\,n\,互質n\,次本原單位根數目為歐拉函數 \varphi (n)

例子

一次單位根有一個  1\,

二次單位根有兩個: +1\,-1\,,只有 -1\,是本原根。

三次單位根

{\displaystyle \left\{1,{\frac {-1+{\sqrt {3}}{i}}{2}},{\frac {-1-{\sqrt {3}}{i}}{2}}\right\},}

其中  {{\mathrm {i}}}\,虛數單位;除  1\,外都是本原根。

四次單位根是

{\displaystyle \left\{1,+{i},-1,-{i}\right\},}

其中  +{{\mathrm {i}}}\,  -{{\mathrm {i}}}\,是本原根。

 

來『系統化』研究『一元多次方程式』之求解卻是拉格朗日的直覺『先見』哩!!此處僅擷維基百科之文本一段︰

Quadratic formula

In elementary algebra, the quadratic formula is the solution of the quadratic equation. There are other ways to solve the quadratic equation instead of using the quadratic formula, such as factoring, completing the square, or graphing. Using the quadratic formula is often the most convenient way.

The general quadratic equation is

ax^{2}+bx+c=0.

Here x represents an unknown, while a, b, and c are constants with a not equal to 0. One can verify that the quadratic formula satisfies the quadratic equation, by inserting the former into the latter. Each of the solutions given by the quadratic formula is called a root of the quadratic equation.

Geometrically, these roots represent the x values at which any parabola, explicitly given as y = ax2 + bx + c, crosses the x-axis. As well as being a formula that will yield the zeros of any parabola, the quadratic equation will give the axis of symmetry of the parabola, and it can be used to immediately determine how many zeros it has.

……

By Lagrange resolvents

For more details on this topic, see Lagrange resolvents.

An alternative way of deriving the quadratic formula is via the method of Lagrange resolvents,[24] which is an early part of Galois theory.[25] This method can be generalized to give the roots of cubic polynomials and quartic polynomials, and leads to Galois theory, which allows one to understand the solution of algebraic equations of any degree in terms of the symmetry group of their roots, the Galois group.

This approach focuses on the roots more than on rearranging the original equation. Given a monic quadratic polynomial

x^2+px+q,

assume that it factors as

x^2+px+q=(x-\alpha)(x-\beta),

Expanding yields

x^2+px+q=x^2-(\alpha+\beta)x+\alpha \beta,

where p = −(α + β) and q = αβ.

Since the order of multiplication does not matter, one can switch α and β and the values of p and q will not change: one can say that p and q are symmetric polynomials in α and β. In fact, they are the elementary symmetric polynomials – any symmetric polynomial in α and β can be expressed in terms of α + β and αβ The Galois theory approach to analyzing and solving polynomials is: given the coefficients of a polynomial, which are symmetric functions in the roots, can one “break the symmetry” and recover the roots? Thus solving a polynomial of degree n is related to the ways of rearranging (“permuting”) n terms, which is called the symmetric group on n letters, and denoted Sn. For the quadratic polynomial, the only way to rearrange two terms is to swap them (“transpose” them), and thus solving a quadratic polynomial is simple.

To find the roots α and β, consider their sum and difference:

These are called the Lagrange resolvents of the polynomial; notice that one of these depends on the order of the roots, which is the key point. One can recover the roots from the resolvents by inverting the above equations:

Thus, solving for the resolvents gives the original roots.

Now r1 = α + β is a symmetric function in α and β, so it can be expressed in terms of p and q, and in fact r1 = −p as noted above. But r2 = αβ is not symmetric, since switching α and β yields r2 = βα (formally, this is termed a group action of the symmetric group of the roots). Since r2 is not symmetric, it cannot be expressed in terms of the coefficients p and q, as these are symmetric in the roots and thus so is any polynomial expression involving them. Changing the order of the roots only changes r2 by a factor of −1, and thus the square r22 = (αβ)2 is symmetric in the roots, and thus expressible in terms of p and q. Using the equation

(\alpha - \beta)^2 = (\alpha + \beta)^2 - 4\alpha\beta\!

yields

r_2^2 = p^2 - 4q\!

and thus

r_2 = \pm \sqrt{p^2 - 4q}.\!

If one takes the positive root, breaking symmetry, one obtains:

and thus

Thus the roots are

  \textstyle{\frac{1}{2}}\left(-p \pm \sqrt{p^2 - 4q}\right)

which is the quadratic formula. Substituting p = b/a, q = c/a yields the usual form for when a quadratic is not monic. The resolvents can be recognized as r1/2 = p/2 = b/2a being the vertex, and r22 = p2 − 4q is the discriminant (of a monic polynomial).

A similar but more complicated method works for cubic equations, where one has three resolvents and a quadratic equation (the “resolving polynomial”) relating r2 and r3, which one can solve by the quadratic equation, and similarly for a quartic equation (degree 4), whose resolving polynomial is a cubic, which can in turn be solved.[24] The same method for a quintic equation yields a polynomial of degree 24, which does not simplify the problem, and in fact solutions to quintic equations in general cannot be expressed using only roots.

───

 

不知是否能得『配方法』之根本焉???