Re: Generate polynomial of specified degree
- To: mathgroup at smc.vnet.net
- Subject: [mg60632] Re: Generate polynomial of specified degree
- From: dh <dh at metrohm.ch>
- Date: Thu, 22 Sep 2005 05:42:19 -0400 (EDT)
- References: <dgtj9q$28g$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Renan,
it is not too hard:
f[x_Symbol,n_Integer]:= Array[c,{n+1},0].x^Range[0,n]
sincerely, Daniel
Renan 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
>