Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Maxima (software)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples of Maxima code == === Basic operations === ==== Arbitrary-precision arithmetic ==== <syntaxhighlight lang="maxima"> bfloat(sqrt(2)), fpprec=40; </syntaxhighlight><math>1.41421356237309504880168872420969807857 \cdot 10^0</math> ==== Function ==== <syntaxhighlight lang="maxima" line="1"> f(x):=x^3$ f(4); </syntaxhighlight><math>64</math> ==== Expand ==== <syntaxhighlight lang="maxima"> expand((a-b)^3); </syntaxhighlight><math>-b^3+3 ab^2-3a^2b+a^3</math> ==== Factor ==== <syntaxhighlight lang="maxima"> factor(x^2-1); </syntaxhighlight><math>(x-1)(x+1)</math> === Solving equations === <math>x^2+a \ x + 1=0</math><syntaxhighlight lang="maxima"> solve(x^2 + a*x + 1, x); </syntaxhighlight><math>[x=-\Biggl(\frac{\sqrt{a^2-4}+a}{2}\Biggr),x=\frac{\sqrt{a^2-4}-a}{2}]</math> === Solving equations numerically === <math>\cos x = x</math><syntaxhighlight lang="maxima"> find_root(cos(x) = x, x, 0, 1); </syntaxhighlight><math>0.7390851332151607</math><syntaxhighlight lang="maxima"> bf_find_root(cos(x) = x, x, 0, 1), fpprec = 50; </syntaxhighlight><math>7.3908513321516064165531208767387340401341175890076 \cdot 10^{-1}</math> === Indefinite integral === <math>\int x^2+\cos x\ d x</math><syntaxhighlight lang="maxima"> integrate(x^2 + cos(x), x); </syntaxhighlight><math>\sin x + \frac{x^3}{3}</math> === Definite integral === <math>\int_{0}^{1}\frac{1}{x^3+1}\, dx</math><syntaxhighlight lang="maxima"> integrate(1/(x^3 + 1), x, 0, 1), ratsimp; </syntaxhighlight><math>\frac{\sqrt3 \log2+\pi}{3^{\frac{3}{2}}}</math> === Numerical integral === <math>\int_{0}^{2} \sin(\sin (x)) \, dx</math><syntaxhighlight lang="maxima"> quad_qags(sin(sin(x)), x, 0, 2)[1]; </syntaxhighlight><math>1.247056058244003</math> === Derivative === <math>{d^3 \over d x^3} \cos^2 x</math><syntaxhighlight lang="maxima"> diff(cos(x)^2, x, 3); </syntaxhighlight><math>8 \cos{x}\sin{x}</math> === Limit === <math>\lim_{x \to \infty} \frac{1+\sinh{x}}{e^{x}}</math><syntaxhighlight lang="maxima"> limit((1+sinh(x))/exp(x), x, inf); </syntaxhighlight><math>\frac{1}{2}</math> === Number theory === <syntaxhighlight lang="maxima"> primes(10, 20); </syntaxhighlight><math>[11,13,17,19]</math><syntaxhighlight lang="maxima"> fib(10); </syntaxhighlight><math>55</math> === Series === <math>\sum_{x=1}^\infty \frac{1}{x^2} </math><syntaxhighlight lang="maxima"> sum(1/x^2, x, 1, inf), simpsum; </syntaxhighlight><math>\frac{\pi^2}{6}</math> === Series expansion === <syntaxhighlight lang="maxima"> taylor(sin(x), x, 0, 9); </syntaxhighlight><math>x-\frac{x^3}{6}+\frac{x^5}{120}-\frac{x^7}{5040}+\frac{x^9}{362880}</math><syntaxhighlight lang="maxima"> niceindices(powerseries(cos(x), x, 0)); </syntaxhighlight><math>\sum_{i=0}^\infty \frac{(-1)^ix^{2i}}{(2i)!}</math> === Special functions === <syntaxhighlight lang="maxima"> bessel_j(0, 4.5); </syntaxhighlight><math>-0.3205425089851214</math><syntaxhighlight lang="maxima"> airy_ai(1.5); </syntaxhighlight><math>0.07174949700810543</math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)