Formal power series: Difference between revisions

Content added Content deleted
Line 1,335: Line 1,335:
tangent = sine / cosine
tangent = sine / cosine
print(tangent(math.pi/3), tangent(math.pi/4), tangent(math.pi/6)) --something like 30000 function calls!</lang>
print(tangent(math.pi/3), tangent(math.pi/4), tangent(math.pi/6)) --something like 30000 function calls!</lang>

=={{header|Mathematica}}==
Mathematica natively supports symbolic power series. For example, this input demonstrates that the integral of the series of Cos minus the series for sin is zero to the order of cancellation.
<lang Mathematica>
cos = Series[Cos[x], {x, 0, 10}];
sin = Series[Sin[x], {x, 0, 8}];
sin - Integrate[cos, x]</lang>
{output}
<pre>O[x]^9</pre>


=={{header|PARI/GP}}==
=={{header|PARI/GP}}==