File: maxima.cnb

package info (click to toggle)
cadabra 1.46-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,244 kB
  • sloc: cpp: 33,188; ansic: 2,724; makefile: 329; yacc: 180; sh: 157; python: 45; lex: 38; lisp: 19
file content (124 lines) | stat: -rw-r--r-- 3,277 bytes parent folder | download | duplicates (6)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
% Cadabra notebook version 1.1
\documentclass[11pt]{article}
\usepackage[textwidth=460pt, textheight=660pt]{geometry}
\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage[parfill]{parskip}
\usepackage{breqn}
\usepackage{tableaux}
\def\specialcolon{\mathrel{\mathop{:}}\hspace{-.5em}}
\renewcommand{\bar}[1]{\overline{#1}}
\begin{document}
% Begin TeX cell closed
\section*{\bf XCadabra as a Maxima front-end}

The XCadabra notebook interface can be used as a front-end for the Maxima computer algebra system, by 
virtue of the \verb|@maxima| command. If you make this command part of the default rules, all input cells
get evaluated by cadabra.
% End TeX cell
{\color[named]{Blue}\begin{verbatim}
::PostDefaultRules( @@maxima(%) ).
\end{verbatim}}
\begin{verbatim}
Assigning property PostDefaultRules to .
\end{verbatim}
{\color[named]{Blue}\begin{verbatim}
integrate( sin(x), x, 0, 3.14 );
\end{verbatim}}
% orig
% 1576947/788474;
% end_orig
\begin{dmath*}[compact, spread=2pt]
1\specialcolon{}= \frac{1576947}{788474};
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
trigsimp( sin(x)**2 + cos(x)**2 );
\end{verbatim}}
% orig
% 1;
% end_orig
\begin{dmath*}[compact, spread=2pt]
2\specialcolon{}= 1;
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
trigexpand( cos(a+b) );
\end{verbatim}}
% orig
% \cos(a) \cos(b) - \sin(a) \sin(b);
% end_orig
\begin{dmath*}[compact, spread=2pt]
3\specialcolon{}= \cos(a) \cos(b) - \sin(a) \sin(b);
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
trigreduce( @(%) );
\end{verbatim}}
% orig
% \cos(b + a);
% end_orig
\begin{dmath*}[compact, spread=2pt]
4\specialcolon{}= \cos(b + a);
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
powerseries(log(sin(x)/x), x, 0);
\end{verbatim}}
% orig
% 1/2 'sum((-1)**i1 2**2 i1 bern(2 i1) x**2 i1/(i1 2 i1!), i1, 1, \infty);
% end_orig
\begin{dmath*}[compact, spread=2pt]
5\specialcolon{}= \frac{1}{2}\, 'sum((-1){}^{i1} 2{}^{2\, i1} bern(2\, i1) \frac{x{}^{2\, i1}}{(i1 2\, i1!)},\quad i1,\quad 1,\quad \infty);
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
[1, 2, 7, x+y];
\end{verbatim}}
% orig
% [1, 2, 7, (y + x)];
% end_orig
\begin{dmath*}[compact, spread=2pt]
6\specialcolon{}= [1,\quad 2,\quad 7,\quad (y + x)];
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
append( @(%), [4, sin(x)]);
\end{verbatim}}
% orig
% [1, 2, 7, (y + x), 4, \sin(x)];
% end_orig
\begin{dmath*}[compact, spread=2pt]
7\specialcolon{}= [1,\quad 2,\quad 7,\quad (y + x),\quad 4,\quad \sin(x)];
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
length( @(%) );
\end{verbatim}}
% orig
% 6;
% end_orig
\begin{dmath*}[compact, spread=2pt]
8\specialcolon{}= 6;
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
@length(7);
\end{verbatim}}
% orig
% 6;
% end_orig
\begin{dmath*}[compact, spread=2pt]
7\specialcolon{}= 6;
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
'diff(f(x),x) = sin(x);
\end{verbatim}}
% orig
% 'diff(f(x), x, 1) = \sin(x);
% end_orig
\begin{dmath*}[compact, spread=2pt]
9\specialcolon{}= 'diff(f(x),\quad x,\quad 1) = \sin(x);
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
desolve( @(%), f(x) );
\end{verbatim}}
% orig
% f(x) = ( - \cos(x) + f(0) + 1);
% end_orig
\begin{dmath*}[compact, spread=2pt]
10\specialcolon{}= f(x) = ( - \cos(x) + f(0) + 1);
\end{dmath*}
\end{document}