Talk:Formal power series: Difference between revisions

Line 16:
 
: I hope multiplication of the Ada solution is correct. As for division, it is impossible to implement because the result can infinite (example: 1-''x'') or non-existent (example: ''x''). --[[User:Dmitry-kazakov|Dmitry-kazakov]] 15:14, 10 March 2009 (UTC)
 
It is like normal multiplication of polynomials, but done on (potentially) infinite elements (we shall truncate the series anyway at some point...) It is enough to do the right grouping according to the ''power'', so say you have (a<sub>0</sub> + a<sub>1</sub>x + ...) and (b<sub>0</sub> + b<sub>1</sub>x + ...) then you do what you would normally do: a<sub>0</sub> with all the b<sub>i</sub>x<sup>i</sup> and so on; but of course you must group equal powers. You could write it shortly as
 
<math>p_n = \sum_{i=0}^n a_ib_{n-i}x^n</math>
 
About division, it is possible: it should be enough that at least one ''coordinate'' is not zero. Of course, if it makes sense or not it still depends on the value where we shall compute the ''function''. The procedure (at least, done by hand...) is the same as for the multiplication. Then you compare the powers and find the right coefficients. On the fly I am not able to write it in a general form that is useful in order to write a computer algorithm, anyway it should be a start point (''a'' are the coeffs of the dividend, ''b'' of the divisor and ''c'' of the quotient):
 
<math>a_0+a_1x+a_2x^2+\dots = c_0b_0 + (c_0b_1+b_0c_1)x + (c_0b_2+c_1b_1+c_2b_0)x^2+\dots</math>
 
This is simply the multiplication, hence you obtain
 
<math>c_0=\frac{b_0}{a_0}</math>
 
<math>c_1=\frac{a_1-c_0b_1}{b_0}</math>
 
where you can substitute c<sub>0</sub> from the previous expression.
Apparently this gives inconsistent results when a coefficient is zero; but this is just because of this is not the right generalized formulation. You can try yourself with something like
 
<math>\frac{\cos x}{\sin x}=\sum_{i=0}^\infty c_ix^i</math>
 
expanding cos/sin as you know. Then you will see that having zero coeffs is not really a problem; doing it by hand is easier than thinking about a general algo that should work for every ''situation'' &mdash;I'm thinking about but not this wine-poisoned-evening (likely someone else more talented has already done it, but there's no fun without selfmade (re)discovering). --[[User:ShinTakezou|ShinTakezou]] 22:45, 10 March 2009 (UTC)
 
==About solving equations==