       Re: Mathematica: Long divison for polynomials

• To: mathgroup at smc.vnet.net
• Subject: [mg83809] Re: Mathematica: Long divison for polynomials
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Sat, 1 Dec 2007 05:41:51 -0500 (EST)
• Organization: The Open University, Milton Keynes, UK
• References: <fiopuv\$ae7\$1@smc.vnet.net>

```Caren Balea wrote:

<snip>

> g(x)/h(x) can be also written as
> g(x)/h(x) = 1 - a1*x  + (a1^2 - a2)*x^2 + ...
>
> How do I obtain the last expression?
> Which command do I need to use?

It looks like you are talking about power series expansion, am I right?
In this case, just use the built-in function *Series* and possibly
*Normal* if you want to manipulate k(x) as a polynomial. For instance,

In:= g[x_] := 1
h[x_] := 1 + a1*x + a2*x^2 + a3*x^3 + a4*x^4

In:= Series[g[x]/h[x], {x, 0, 2}]

Out= (SeriesData[\$CellContext`x, 0, {
1, -\$CellContext`a1, \$CellContext`a1^2 - \$CellContext`a2}, 0, 3, 1])

(* The above line looks better within the FrontEnd ! *)

In:= k[x_] = Normal@Series[g[x]/h[x], {x, 0, 2}]

Out= 1 - a1 x + (a1^2 - a2) x^2

In:= k

Out= 1 - 2 a1 + 4 (a1^2 - a2)

Regards,
--
Jean-Marc

```

• Prev by Date: Question about exponent shorthand
• Next by Date: Re: how draw box with open front
• Previous by thread: Re: Question about exponent shorthand
• Next by thread: Re: Mathematica: Long divison for polynomials