aboutsummaryrefslogtreecommitdiff
path: root/src/input/opalg.input.pamphlet
blob: cf38ff570ffad505abe12db47d4250d1e3b9623f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input opalg.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991, 1995.
@
<<*>>=
<<license>>

)cl all
-- This is the recursive definition of the Legendre polynomials
L n ==
  n = 0 => 1
  n = 1 => x
  (2*n-1)/n * x * L(n-1) - (n-1)/n * L(n-2)

L 5

-- Create the differential operator d/dx on Q[x]
dx := operator("D")::OP(POLY FRAC INT)
-- and attach the map d/dx to it:
evaluate(dx, p +-> differentiate(p, 'x))$OP(POLY FRAC INT)

-- This is the differential equation satisfied by the nth Legendre poly:
E n == (1 - x**2) * dx**2 - 2 * x * dx + n*(n+1)
E 5
[L i for i in 1..10]
[E i for i in 1..10]
[(E i)(L i) for i in 1..10]
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}