Formal power series: Difference between revisions
m
adding maxima
Capra Hircus (talk | contribs) m (adding maxima) |
|||
Line 1,012:
=={{header|Java}}==
See [[Formal power series/Java]]
=={{header|Maxima}}==
<lang maxima>deftaylor(f(x), sum(n * x^n, n, 0, inf))$
taylor(f(x), x, 0, 10);
/ * x + 2 * x^2 + 3 * x^3 + 4 * x^4 + 5 * x^5 + 6 * x^6 + 7 * x^7 + 8 * x^8 + 9 * x^9 + 10 * x^10 + ... * /
taylor(f(x)^2, x, 0, 10);
/ * x^2 + 4 * x^3 + 10 * x^4 + 20 * x^5 + 35 * x^6 + 56 * x^7 + 84 * x^8 + 120 * x^9 + 165 * x^10 + ... * /
deftaylor(fcos(x), sum((-1)^n * x^(2 * n) / (2 * n)!, n, 0, inf))$
deftaylor(fsin(x), sum((-1)^n * x^(2 * n + 1) / (2 * n + 1)!, n, 0, inf))$
taylor(fcos(x)^2 + fsin(x)^2, x, 0, 20);
/ * 1 + ... * /</lang>
=={{header|Lua}}==
|