Re: Generate polynomial of specified degree

• To: mathgroup at smc.vnet.net
• Subject: [mg60640] Re: [mg60618] Generate polynomial of specified degree
• From: Chris Chiasson <chris.chiasson at gmail.com>
• Date: Thu, 22 Sep 2005 05:42:34 -0400 (EDT)
• References: <200509220608.CAA01863@smc.vnet.net>
• Reply-to: Chris Chiasson <chris.chiasson at gmail.com>
• Sender: owner-wri-mathgroup at wolfram.com

```Clear[f]
Module[{C},f[x_,0]=C[0];
f[x_,degree_Integer/;degree>0]:=C[degree] x^degree+f[x,degree-1]]

f[junk,10]

seems to work

On 9/22/05, Renan <renan.birck at gmail.com> wrote:
> Hello,
>
> Sorry if this may seem a silly question, but I readed the Mathematica
> help and found no references.
>
> Is there any function that can generate a polynomial of a given degree?
>
> e.g.
>
> For degree 1, f[x] would return a x + b
> For degree 2, f[x] would return a x^2 + b x + c (quadratic equation)
> For degree 3, f[x] would return a x^3 + b x^2 + c x + d (quadratic equation)
>
> Thanks,
> Renan - Canoas, RS, Brazil
>
>

--
Chris Chiasson
http://chrischiasson.com/contact/chris_chiasson

```

• Prev by Date: Re: Generate polynomial of specified degree
• Next by Date: Re: Beginner: Importing files, maintaining file format.
• Previous by thread: Generate polynomial of specified degree
• Next by thread: Re: Generate polynomial of specified degree